css - Bootstrap: working with LESS, what's the good way? -
i have couple of questions hope me clarify working semantic markup, using less bootstrap 3 mixins.
first, columns setup:
on non-semantic html you'd declare cols on div class <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12"></div> example.
as stated on bootstrap documentation should declare amount of columns given div .make-xx-column(@columnms), but, if want replicate non-semantic it's supposed code be:
.make-lg-column(4); .make-md-column(6); .make-sm-column(12); .make-xs-column(12); with found when on big resolution (more 1200px) , if have defined .make-lg-column(4); , .make-md-column(6); result 6 medium columns showed. on inspector shows @media (min-width: 992px) , rule on @media (min-width: 1200px)
what then, correct way set different column values div? seems not equal how you'd set them on non-semantic layout.
finally question padding,
why when on regular bootstrap css column has defined padding (15px default) on mixins default padding 0px? forces set padding each time declare column amount (.make-lg-column(12, 30px);) ?
i appreciate if can me working right way, i'm sorry it's first time work less , semantic html code bootstrap.
i'm sure question has an answer on already, time being.
you should call mixins smallest grid (xs) first, or better call mixins small width. (kind of mobile first)
the above make sense because of media queries grid defined min-width, see http://getbootstrap.com/css/#grid.
if set largest grid first (min-width:1200px) follow (min-width:992px) both evaluate true screensize wider 1199 pixels, , latest override first.
you should use:
.make-xs-column(12); .make-sm-column(12); .make-md-column(6); .make-lg-column(4); why when on regular bootstrap css column has defined padding (15px default) on mixins default padding 0px? forces set padding each time declare column amount (.make-lg-column(12, 30px);) ?
the default grids have gutter of 30 pixels (set @grid-gutter-width) between columns. 15 pixels on each side of columns, makes 2 x 15 pixels between each column.
why when on regular bootstrap css column has defined padding (15px default) on >the mixins default padding 0px? forces set padding each time declare >a column amount (.make-lg-column(12, 30px);) ?
i found that:
@import "variables"; @import "mixins"; selector { .make-lg-column(12, 30px); } compiles css code follows:
selector { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 1200px) { selector { float: left; width: 100%; } }
Comments
Post a Comment