mirror of https://github.com/twbs/bootstrap.git
				
				
				
			Cleanup
- Rename and move the variable to variables file - Move code to the grid file - Use the mixin to generate our own classes - Wrap in a grid classes enabled conditional - Document the mixin
This commit is contained in:
		
							parent
							
								
									acb2b7061c
								
							
						
					
					
						commit
						d08567797f
					
				| 
						 | 
				
			
			@ -168,18 +168,6 @@
 | 
			
		|||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
$row-columns: 6 !default;
 | 
			
		||||
 | 
			
		||||
@each $breakpoint in map-keys($grid-breakpoints) {
 | 
			
		||||
  $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
 | 
			
		||||
 | 
			
		||||
  @for $i from 1 through $row-columns {
 | 
			
		||||
    .row-cols#{$infix}-#{$i} > [class^="col"] {
 | 
			
		||||
      flex: 0 0 calc(100% / #{$i});
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//
 | 
			
		||||
// Card groups
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -46,6 +46,16 @@
 | 
			
		|||
    @include make-row();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @each $breakpoint in map-keys($grid-breakpoints) {
 | 
			
		||||
    $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
 | 
			
		||||
 | 
			
		||||
    @for $i from 1 through $grid-row-columns {
 | 
			
		||||
      .row-cols#{$infix}-#{$i} {
 | 
			
		||||
        @include row-cols($i);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // Remove the negative margin from default .row, then the horizontal padding
 | 
			
		||||
  // from all immediate children columns (to prevent runaway style inheritance).
 | 
			
		||||
  .no-gutters {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -227,6 +227,7 @@ $container-max-widths: (
 | 
			
		|||
 | 
			
		||||
$grid-columns:                12 !default;
 | 
			
		||||
$grid-gutter-width:           30px !default;
 | 
			
		||||
$grid-row-columns:            6 !default;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Components
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -49,3 +49,14 @@
 | 
			
		|||
  $num: $size / $columns;
 | 
			
		||||
  margin-left: if($num == 0, 0, percentage($num));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Row columns
 | 
			
		||||
//
 | 
			
		||||
// Specify on a parent element(e.g., .row) to force immediate children into NN
 | 
			
		||||
// numberof columns. Supports wrapping to new lines, but does not do a Masonry
 | 
			
		||||
// style grid.
 | 
			
		||||
@mixin row-cols($count) {
 | 
			
		||||
  & > [class^="col"] {
 | 
			
		||||
    flex: 0 0 calc(100% / #{$count});
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -381,6 +381,20 @@ Use these row columns classes to quickly create basic grid layouts or to control
 | 
			
		|||
{% include example.html content=example %}
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
You can also use the accompanying Sass mixin, `row-cols()`:
 | 
			
		||||
 | 
			
		||||
{% highlight scss %}
 | 
			
		||||
.element {
 | 
			
		||||
  // Three columns to start
 | 
			
		||||
  @include row-cols(3);
 | 
			
		||||
 | 
			
		||||
  // Five columns from medium breakpoint up
 | 
			
		||||
  @include media-breakpoint-up(md) {
 | 
			
		||||
    @include row-cols(5);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
{% endhighlight %}
 | 
			
		||||
 | 
			
		||||
## Alignment
 | 
			
		||||
 | 
			
		||||
Use flexbox alignment utilities to vertically and horizontally align columns. **Internet Explorer 10-11 do not support vertical alignment of flex items when the flex container has a `min-height` as shown below.** [See Flexbugs #3 for more details.](https://github.com/philipwalton/flexbugs#flexbug-3)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue