// Utility generator // Used to generate utilities & print utilities @mixin generate-utility($utility, $infix, $is-rfs-media-query: false) { $values: map-get($utility, values); // If the values are a list or string, convert it into a map @if type-of($values) == "string" or type-of(nth($values, 1)) != "list" { $values: zip($values, $values); } @each $key, $value in $values { $properties: map-get($utility, property); // Multiple properties are possible, for example with vertical or horizontal margins or paddings @if type-of($properties) == "string" { $properties: append((), $properties); } // Use custom class if present $property-class: if(map-has-key($utility, class), map-get($utility, class), nth($properties, 1)); $property-class: if($property-class == null, "", $property-class); // State params to generate pseudo-classes $state: if(map-has-key($utility, state), map-get($utility, state), ()); $infix: if($property-class == "" and str-slice($infix, 1, 1) == "-", str-slice($infix, 2), $infix); // Don't prefix if value key is null (eg. with shadow class) $property-class-modifier: if($key, if($property-class == "" and $infix == "", "", "-") + $key, ""); @if map-get($utility, rfs) { // Inside the media query @if $is-rfs-media-query { $val: rfs-value($value); // Do not render anything if fluid and non fluid values are the same $value: if($val == rfs-fluid-value($value), null, $val); } @else { $value: rfs-fluid-value($value); } } $is-rtl: map-get($utility, rtl); @if $value != null { @if $is-rtl == false { /* rtl:begin:remove */ } .#{$property-class + $infix + $property-class-modifier} { @each $property in $properties { #{$property}: $value if($enable-important-utilities, !important, null); } } @each $pseudo in $state { .#{$property-class + $infix + $property-class-modifier}-#{$pseudo}:#{$pseudo} { @each $property in $properties { #{$property}: $value if($enable-important-utilities, !important, null); } } } @if $is-rtl == false { /* rtl:end:remove */ } } } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
_alert.scss | File | 268 B | 0644 |
|
_border-radius.scss | File | 1.98 KB | 0644 |
|
_box-shadow.scss | File | 398 B | 0644 |
|
_breakpoints.scss | File | 4.38 KB | 0644 |
|
_buttons.scss | File | 4.13 KB | 0644 |
|
_caret.scss | File | 1.44 KB | 0644 |
|
_clearfix.scss | File | 147 B | 0644 |
|
_color-scheme.scss | File | 167 B | 0644 |
|
_container.scss | File | 265 B | 0644 |
|
_deprecate.scss | File | 613 B | 0644 |
|
_forms.scss | File | 3.8 KB | 0644 |
|
_gradients.scss | File | 1.92 KB | 0644 |
|
_grid.scss | File | 3.88 KB | 0644 |
|
_image.scss | File | 395 B | 0644 |
|
_list-group.scss | File | 509 B | 0644 |
|
_lists.scss | File | 168 B | 0644 |
|
_pagination.scss | File | 741 B | 0644 |
|
_reset-text.scss | File | 495 B | 0644 |
|
_resize.scss | File | 202 B | 0644 |
|
_table-variants.scss | File | 980 B | 0644 |
|
_text-truncate.scss | File | 168 B | 0644 |
|
_transition.scss | File | 661 B | 0644 |
|
_utilities.scss | File | 2.23 KB | 0644 |
|
_visually-hidden.scss | File | 1011 B | 0644 |
|