|
20 | 20 | $property-class: if(map-has-key($utility, class), map-get($utility, class), nth($properties, 1));
|
21 | 21 | $property-class: if($property-class == null, "", $property-class);
|
22 | 22 |
|
| 23 | + // Use custom CSS variable name if present, otherwise default to `class` |
| 24 | + $css-variable-name: if(map-has-key($utility, css-variable-name), map-get($utility, css-variable-name), map-get($utility, class)); |
| 25 | + |
23 | 26 | // State params to generate pseudo-classes
|
24 | 27 | $state: if(map-has-key($utility, state), map-get($utility, state), ());
|
25 | 28 |
|
|
28 | 31 | // Don't prefix if value key is null (eg. with shadow class)
|
29 | 32 | $property-class-modifier: if($key, if($property-class == "" and $infix == "", "", "-") + $key, "");
|
30 | 33 |
|
31 |
| - // Generate CSS Variable |
32 |
| - $generate-vars: if(map-has-key($utility, vars), map-get($utility, vars), false); |
33 |
| - $generate-only-vars: if(map-has-key($utility, only-vars), map-get($utility, only-vars), false); |
34 |
| - |
35 |
| - // Generate RTL version |
36 |
| - $generate-rtl: if(map-has-key($utility, rtl), map-get($utility, rtl), false); |
37 |
| - |
38 |
| - // Add theme prefix |
39 |
| - $theme-prefix: if(map-has-key($utility, theme-prefix), map-get($utility, theme-prefix), false); |
40 |
| - |
41 | 34 | @if map-get($utility, rfs) {
|
42 | 35 | // Inside the media query
|
43 | 36 | @if $is-rfs-media-query {
|
|
62 | 55 |
|
63 | 56 | @if $is-css-var {
|
64 | 57 | .#{$property-class + $infix + $property-class-modifier} {
|
65 |
| - --#{$variable-prefix}#{$property-class}: #{$value}; |
| 58 | + --#{$variable-prefix}#{$css-variable-name}: #{$value}; |
66 | 59 | }
|
67 | 60 |
|
68 | 61 | @each $pseudo in $state {
|
69 | 62 | .#{$property-class + $infix + $property-class-modifier}-#{$pseudo}:#{$pseudo} {
|
70 |
| - --#{$variable-prefix}#{$property-class}: #{$value}; |
| 63 | + --#{$variable-prefix}#{$css-variable-name}: #{$value}; |
71 | 64 | }
|
72 | 65 | }
|
73 | 66 | } @else {
|
74 | 67 | .#{$property-class + $infix + $property-class-modifier} {
|
75 | 68 | @each $property in $properties {
|
76 | 69 | @if $is-local-vars {
|
77 |
| - @each $local-var, $value in $is-local-vars { |
78 |
| - --#{$variable-prefix}#{$local-var}: #{$value}; |
| 70 | + @each $local-var, $variable in $is-local-vars { |
| 71 | + --#{$variable-prefix}#{$local-var}: #{$variable}; |
79 | 72 | }
|
80 | 73 | }
|
81 |
| - @if $generate-rtl == true { |
82 |
| - @include ltr-rtl($property, $value, null, null, if($enable-important-utilities, !important, null)); |
83 |
| - } |
84 |
| - @else { |
85 |
| - #{$property}: $value if($enable-important-utilities, !important, null); |
86 |
| - } |
| 74 | + #{$property}: $value if($enable-important-utilities, !important, null); |
87 | 75 | }
|
88 | 76 | }
|
89 | 77 |
|
|
0 commit comments