_alert.scss
3 years ago
_background-variant.scss
3 years ago
_badge.scss
3 years ago
_border-radius.scss
3 years ago
_box-shadow.scss
3 years ago
_breakpoints.scss
3 years ago
_buttons.scss
3 years ago
_caret.scss
3 years ago
_clearfix.scss
3 years ago
_deprecate.scss
3 years ago
_float.scss
3 years ago
_forms.scss
3 years ago
_gradients.scss
3 years ago
_grid-framework.scss
3 years ago
_grid.scss
3 years ago
_hover.scss
3 years ago
_image.scss
3 years ago
_list-group.scss
3 years ago
_lists.scss
3 years ago
_nav-divider.scss
3 years ago
_pagination.scss
3 years ago
_reset-text.scss
3 years ago
_resize.scss
3 years ago
_screen-reader.scss
3 years ago
_size.scss
3 years ago
_table-row.scss
3 years ago
_text-emphasis.scss
3 years ago
_text-hide.scss
3 years ago
_text-truncate.scss
3 years ago
_transition.scss
3 years ago
_visibility.scss
3 years ago
_grid.scss
70 lines
| 1 | /// Grid system |
| 2 | // |
| 3 | // Generate semantic grid columns with these mixins. |
| 4 | |
| 5 | @mixin make-container($gutter: $grid-gutter-width) { |
| 6 | width: 100%; |
| 7 | padding-right: $gutter / 2; |
| 8 | padding-left: $gutter / 2; |
| 9 | margin-right: auto; |
| 10 | margin-left: auto; |
| 11 | } |
| 12 | |
| 13 | |
| 14 | // For each breakpoint, define the maximum width of the container in a media query |
| 15 | @mixin make-container-max-widths($max-widths: $container-max-widths, $breakpoints: $grid-breakpoints) { |
| 16 | @each $breakpoint, $container-max-width in $max-widths { |
| 17 | @include media-breakpoint-up($breakpoint, $breakpoints) { |
| 18 | max-width: $container-max-width; |
| 19 | } |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | @mixin make-row($gutter: $grid-gutter-width) { |
| 24 | display: flex; |
| 25 | flex-wrap: wrap; |
| 26 | margin-right: -$gutter / 2; |
| 27 | margin-left: -$gutter / 2; |
| 28 | } |
| 29 | |
| 30 | @mixin make-col-ready($gutter: $grid-gutter-width) { |
| 31 | position: relative; |
| 32 | // Prevent columns from becoming too narrow when at smaller grid tiers by |
| 33 | // always setting `width: 100%;`. This works because we use `flex` values |
| 34 | // later on to override this initial width. |
| 35 | width: 100%; |
| 36 | padding-right: $gutter / 2; |
| 37 | padding-left: $gutter / 2; |
| 38 | } |
| 39 | |
| 40 | @mixin make-col($size, $columns: $grid-columns) { |
| 41 | flex: 0 0 percentage($size / $columns); |
| 42 | // Add a `max-width` to ensure content within each column does not blow out |
| 43 | // the width of the column. Applies to IE10+ and Firefox. Chrome and Safari |
| 44 | // do not appear to require this. |
| 45 | max-width: percentage($size / $columns); |
| 46 | } |
| 47 | |
| 48 | @mixin make-col-auto() { |
| 49 | flex: 0 0 auto; |
| 50 | width: auto; |
| 51 | max-width: 100%; // Reset earlier grid tiers |
| 52 | } |
| 53 | |
| 54 | @mixin make-col-offset($size, $columns: $grid-columns) { |
| 55 | $num: $size / $columns; |
| 56 | margin-left: if($num == 0, 0, percentage($num)); |
| 57 | } |
| 58 | |
| 59 | // Row columns |
| 60 | // |
| 61 | // Specify on a parent element(e.g., .row) to force immediate children into NN |
| 62 | // numberof columns. Supports wrapping to new lines, but does not do a Masonry |
| 63 | // style grid. |
| 64 | @mixin row-cols($count) { |
| 65 | & > * { |
| 66 | flex: 0 0 100% / $count; |
| 67 | max-width: 100% / $count; |
| 68 | } |
| 69 | } |
| 70 |