Skip to content

Commit

Permalink
add .row-no-gutters class
Browse files Browse the repository at this point in the history
fixes #15180, fixes #19107, fixes #9102, fixes #7368
  • Loading branch information
mdo committed Jul 3, 2017
1 parent 2fb0cd5 commit 48f1482
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
32 changes: 32 additions & 0 deletions docs/_includes/css/grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,38 @@ <h2 id="grid-responsive-resets">Responsive column resets</h2>
{% endhighlight %}


<h2 id="grid-remove-gutters">Remove gutters</h2>
<p>Remove the gutters from a row and it's columns with the <code>.row-no-gutters</code> class.</p>
<div class="row row-no-gutters show-grid">
<div class="col-xs-12 col-md-8">.col-xs-12 .col-md-8</div>
<div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
</div>
<div class="row row-no-gutters show-grid">
<div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
<div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
<div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
</div>
<div class="row row-no-gutters show-grid">
<div class="col-xs-6">.col-xs-6</div>
<div class="col-xs-6">.col-xs-6</div>
</div>
{% highlight html %}
<div class="row row-no-gutters">
<div class="col-xs-12 col-md-8">.col-xs-12 .col-md-8</div>
<div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
</div>
<div class="row row-no-gutters">
<div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
<div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
<div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
</div>
<div class="row row-no-gutters">
<div class="col-xs-6">.col-xs-6</div>
<div class="col-xs-6">.col-xs-6</div>
</div>
{% endhighlight %}


<h2 id="grid-offsetting">Offsetting columns</h2>
<p>Move columns to the right using <code>.col-md-offset-*</code> classes. These classes increase the left margin of a column by <code>*</code> columns. For example, <code>.col-md-offset-4</code> moves <code>.col-md-4</code> over four columns.</p>
<div class="row show-grid">
Expand Down
1 change: 1 addition & 0 deletions docs/_includes/nav/css.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<li><a href="#grid-example-mixed-complete">Ex: Mobile, tablet, desktop</a></li>
<li><a href="#grid-example-wrapping">Ex: Column wrapping</a></li>
<li><a href="#grid-responsive-resets">Responsive column resets</a></li>
<li><a href="#grid-remove-gutters">Remove gutters</a></li>
<li><a href="#grid-offsetting">Offsetting columns</a></li>
<li><a href="#grid-nesting">Nesting columns</a></li>
<li><a href="#grid-column-ordering">Column ordering</a></li>
Expand Down
10 changes: 10 additions & 0 deletions less/grid.less
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@
.make-row();
}

.row-no-gutters {
margin-right: 0;
margin-left: 0;

[class*="col-"] {
padding-left: 0;
padding-right: 0;
}
}


// Columns
//
Expand Down

0 comments on commit 48f1482

Please sign in to comment.