@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 {
flex-grow: 1;
max-width: 100%;
}
+
+ @for $i from 1 through $grid-row-columns {
+ .row-cols#{$infix}-#{$i} {
+ @include row-cols($i);
+ }
+ }
+
.col#{$infix}-auto {
flex: 0 0 auto;
width: auto;
// 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});
+ & > * {
+ flex: 0 0 100% / $count;
+ max-width: 100% / $count;
}
}
{{< /example >}}
</div>
+<div class="bd-example-row">
+{{< example >}}
+<div class="container">
+ <div class="row row-cols-4">
+ <div class="col">Column</div>
+ <div class="col">Column</div>
+ <div class="col-6">Column</div>
+ <div class="col">Column</div>
+ </div>
+</div>
+{{< /example >}}
+</div>
+
You can also use the accompanying Sass mixin, `row-cols()`:
{{< highlight scss >}}