i’m trying to use the make-col() mixin provided by SASS. http://v4-alpha.getbootstrap.com/layout/grid/. What I’m trying to do is create two columns. With compiled classes, I’m table to do
And I get two divs that are floated next to each other in any size larger than sm
.
In Bootstrap Sass (I’m using it part of React), when I do:
.row {
@include make-row()
}
.left {
@include make-col(3)
}
.right {
@include make-col(9);
}
It does float the two next to each other, but when I shrink the screen down, the two don’t block out. They remain floated. How do I get Bootstrap to mirror the above example when using mixins.
As an aside, from the documentation: @mixin make-col($size, $columns: $grid-columns, $gutter: $grid-gutter-width)
– What exactly is size
? Is it the number of columns? I’m confused because there is also a $columns
variable.
3
Answers
I think you need a wrapper to your columns, or a parent container.
Use the
make-row
mixin for that.$size
is used to control the width of your columns.Hope it helps !
There is no detailed information on col mixins. From my experiments:
There are no mixins to create sm, md, lg col’s in BS4. Instead one can extend the col-* classes.
Ex:
Update
In Bootstrap 4.1<, there are mixins available for accomplishing grid system specific tasks. Those are the column related functions:
Example usage
HTML
SASS
Sources: