-
Notifications
You must be signed in to change notification settings - Fork 3
grids.scss
Based on Bootstrap Spacing Utils.
we include a wide range of shorthand responsive margin and padding utility classes to modify an element’s appearance.
Assign responsive-friendly margin or padding values to an element or a subset of its sides with shorthand classes. Includes support for individual properties, all properties, and vertical and horizontal properties. Classes are built from a default Sass map ranging from .25rem to 3rem.
Spacing utilities that apply to all breakpoints, from xs to xl, have no breakpoint abbreviation in them. This is because those classes are applied from min-width: 0 and up, and thus are not bound by a media query. The remaining breakpoints, however, do include a breakpoint abbreviation.
The classes are named using the format {property}{sides}-{breakpoint}-{size} for xs, sm, md, lg, and xl.
Where property is one of:
-
m- for classes that setmargin -
p- for classes that setpadding
Where sides is one of:
-
t- for classes that setmargin-toporpadding-top -
b- for classes that setmargin-bottomorpadding-bottom -
l- for classes that setmargin-leftorpadding-left -
r- for classes that setmargin-rightorpadding-right -
x- for classes that set both*-leftand*-right -
y- for classes that set both*-topand*-bottom - blank - for classes that set a
marginorpaddingon all 4 sides of the element
Where size is one of:
-
0- for classes that eliminate themarginorpaddingby setting it to0 -
1- (by default) for classes that set themarginorpaddingto$spacer * .25 -
2- (by default) for classes that set themarginorpaddingto$spacer * .5 -
3- (by default) for classes that set themarginorpaddingto$spacer -
4- (by default) for classes that set themarginorpaddingto$spacer * 1.5 -
5- (by default) for classes that set themarginorpaddingto$spacer * 3 -
auto- for classes that set themarginto auto
Based on Flexbox Grid.
All you need to remember is .row and .col-{breakpoint}-{column count}.
<div class="row">
<div class="col-xs-12"></div>
</div>Responsive modifiers enable specifying different column sizes, offsets, alignment and distribution at xs, sm, md, lg, and xl viewport widths.
Percent based widths allow fluid resizing of columns and rows.
Offset a column. .col-{breakpoint}-offset-{column count 1-12}
Add any number of auto sizing columns to a row. Let the grid figure it out. .col-{breakpoint}
Add classes to align elements to the start or end of a row as well as the top, bottom, or center of a column.
.start-{breakpoint}.center-{breakpoint}.end-{breakpoint}.top-{breakpoint}.middle-{breakpoint}.bottom-{breakpoint}
Add classes to distribute the contents of a row or column.
.around-{breakpoint}.between-{breakpoint}
Add classes to reorder columns.
.first-{breakpoint}.last-{breakpoint}
Use .row.reverse to reverse the order of the columns.