mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-21 12:51:52 +02:00
Add equal column mixin (#32155)
This commit is contained in:
@@ -26,9 +26,14 @@
|
|||||||
margin-top: var(--#{$variable-prefix}gutter-y);
|
margin-top: var(--#{$variable-prefix}gutter-y);
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin make-col($size, $columns: $grid-columns) {
|
@mixin make-col($size: false, $columns: $grid-columns) {
|
||||||
|
@if $size {
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
width: percentage($size / $columns);
|
width: percentage($size / $columns);
|
||||||
|
} @else {
|
||||||
|
flex: 1 1 0;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin make-col-auto() {
|
@mixin make-col-auto() {
|
||||||
|
@@ -434,6 +434,9 @@ Mixins are used in conjunction with the grid variables to generate semantic CSS
|
|||||||
|
|
||||||
// Make the element grid-ready (applying everything but the width)
|
// Make the element grid-ready (applying everything but the width)
|
||||||
@include make-col-ready();
|
@include make-col-ready();
|
||||||
|
|
||||||
|
// Without optional size values, the mixin will create equal columns (similar to using .col)
|
||||||
|
@include make-col();
|
||||||
@include make-col($size, $columns: $grid-columns);
|
@include make-col($size, $columns: $grid-columns);
|
||||||
|
|
||||||
// Get fancy by offsetting, or changing the sort order
|
// Get fancy by offsetting, or changing the sort order
|
||||||
|
Reference in New Issue
Block a user