// Framework grid generation // // Used only by Bootstrap to generate the correct number of grid classes given // any value of `$grid-columns`. // [converter] This is defined recursively in LESS, but Sass supports real loops @mixin make-grid-columns($i: 1, $list: ".col-xs-#{$i}, .col-sm-#{$i}, .col-md-#{$i}, .col-lg-#{$i}") { @for $i from (1 + 1) through $grid-columns { $list: "#{$list}, .col-xs-#{$i}, .col-sm-#{$i}, .col-md-#{$i}, .col-lg-#{$i}"; } #{$list} { position: relative; // Prevent columns from collapsing when empty min-height: 1px; // Inner gutter via padding padding-left: ($grid-gutter-width / 2); padding-right: ($grid-gutter-width / 2); } } // [converter] This is defined recursively in LESS, but Sass supports real loops @mixin float-grid-columns($class, $i: 1, $list: ".col-#{$class}-#{$i}") { @for $i from (1 + 1) through $grid-columns { $list: "#{$list}, .col-#{$class}-#{$i}"; } #{$list} { float: left; } } @mixin calc-grid-column($index, $class, $type) { @if ($type == width) and ($index > 0) { .col-#{$class}-#{$index} { width: percentage(($index / $grid-columns)); } } @if ($type == push) and ($index > 0) { .col-#{$class}-push-#{$index} { left: percentage(($index / $grid-columns)); } } @if ($type == push) and ($index == 0) { .col-#{$class}-push-0 { left: auto; } } @if ($type == pull) and ($index > 0) { .col-#{$class}-pull-#{$index} { right: percentage(($index / $grid-columns)); } } @if ($type == pull) and ($index == 0) { .col-#{$class}-pull-0 { right: auto; } } @if ($type == offset) { .col-#{$class}-offset-#{$index} { margin-left: percentage(($index / $grid-columns)); } } } // [converter] This is defined recursively in LESS, but Sass supports real loops @mixin loop-grid-columns($columns, $class, $type) { @for $i from 0 through $columns { @include calc-grid-column(12-$i, $class, $type); } } // Create grid for specific class @mixin make-grid($class) { @include float-grid-columns($class); @include loop-grid-columns($grid-columns, $class, width); @include loop-grid-columns($grid-columns, $class, pull); @include loop-grid-columns($grid-columns, $class, push); @include loop-grid-columns($grid-columns, $class, offset); }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
_alerts.scss | File | 263 B | 0644 |
|
_background-variant.scss | File | 212 B | 0644 |
|
_border-radius.scss | File | 492 B | 0644 |
|
_buttons.scss | File | 1.04 KB | 0644 |
|
_center-block.scss | File | 126 B | 0644 |
|
_clearfix.scss | File | 611 B | 0644 |
|
_forms.scss | File | 2.61 KB | 0644 |
|
_gradients.scss | File | 4.29 KB | 0644 |
|
_grid-framework.scss | File | 2.29 KB | 0644 |
|
_grid.scss | File | 3.12 KB | 0644 |
|
_hide-text.scss | File | 599 B | 0644 |
|
_image.scss | File | 1.25 KB | 0644 |
|
_labels.scss | File | 169 B | 0644 |
|
_list-group.scss | File | 593 B | 0644 |
|
_nav-divider.scss | File | 209 B | 0644 |
|
_nav-vertical-align.scss | File | 370 B | 0644 |
|
_opacity.scss | File | 152 B | 0644 |
|
_pagination.scss | File | 460 B | 0644 |
|
_panels.scss | File | 543 B | 0644 |
|
_progress-bar.scss | File | 202 B | 0644 |
|
_reset-filter.scss | File | 246 B | 0644 |
|
_resize.scss | File | 202 B | 0644 |
|
_responsive-visibility.scss | File | 503 B | 0644 |
|
_size.scss | File | 147 B | 0644 |
|
_tab-focus.scss | File | 165 B | 0644 |
|
_table-row.scss | File | 715 B | 0644 |
|
_text-emphasis.scss | File | 189 B | 0644 |
|
_text-overflow.scss | File | 168 B | 0644 |
|
_vendor-prefixes.scss | File | 6.53 KB | 0644 |
|