@volverjs/style 0.1.22 → 0.1.24-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -0
- package/dist/base.css +1 -1
- package/dist/components/vv-accordion.css +1 -1
- package/dist/components/vv-alert.css +1 -1
- package/dist/components/vv-badge.css +1 -1
- package/dist/components/vv-button.css +1 -1
- package/dist/components/vv-card.css +1 -1
- package/dist/components/vv-checkbox.css +1 -1
- package/dist/components/vv-dropdown-action.css +1 -1
- package/dist/components/vv-dropdown-option.css +1 -1
- package/dist/components/vv-dropdown.css +1 -1
- package/dist/components/vv-input-file.css +1 -1
- package/dist/components/vv-input-text.css +1 -1
- package/dist/components/vv-nav.css +1 -1
- package/dist/components/vv-radio.css +1 -1
- package/dist/components/vv-select.css +1 -1
- package/dist/components/vv-text.css +1 -1
- package/dist/components/vv-tooltip.css +1 -1
- package/dist/components.css +1 -1
- package/dist/export.css +1 -1
- package/dist/props/breakpoints.css +1 -1
- package/dist/props/colors.css +1 -1
- package/dist/props/effects.css +1 -1
- package/dist/props/spacing.css +1 -1
- package/dist/props/transitions.css +1 -1
- package/dist/props/typography.css +1 -1
- package/dist/props.css +1 -1
- package/dist/reset.css +1 -1
- package/dist/themes/dark/components.css +1 -1
- package/dist/themes/dark/props.css +1 -1
- package/dist/themes/dark/volver.css +1 -1
- package/dist/utilities/borders.css +1 -1
- package/dist/utilities/colors.css +1 -1
- package/dist/utilities/effects.css +1 -1
- package/dist/utilities/flexbox.css +1 -1
- package/dist/utilities/grid.css +1 -1
- package/dist/utilities/layout.css +1 -1
- package/dist/utilities/sizing.css +1 -1
- package/dist/utilities/typography.css +1 -1
- package/dist/utilities.css +1 -1
- package/dist/volver.css +1 -1
- package/package.json +22 -22
- package/src/_config.scss +12 -0
- package/src/_layers.scss +4 -0
- package/src/_preflight.scss +2 -0
- package/src/components/vv-accordion-group.scss +3 -0
- package/src/components/vv-accordion.scss +3 -0
- package/src/components/vv-alert-group.scss +3 -0
- package/src/components/vv-alert.scss +3 -0
- package/src/components/vv-avatar-group.scss +3 -0
- package/src/components/vv-avatar.scss +3 -0
- package/src/components/vv-badge.scss +3 -0
- package/src/components/vv-breadcrumb.scss +3 -0
- package/src/components/vv-button-group.scss +3 -0
- package/src/components/vv-button.scss +3 -0
- package/src/components/vv-card.scss +3 -0
- package/src/components/vv-checkbox-group.scss +3 -0
- package/src/components/vv-checkbox.scss +3 -0
- package/src/components/vv-dialog.scss +3 -0
- package/src/components/vv-dropdown-action.scss +3 -0
- package/src/components/vv-dropdown-optgroup.scss +3 -0
- package/src/components/vv-dropdown-option.scss +3 -0
- package/src/components/vv-dropdown.scss +3 -0
- package/src/components/vv-input-file.scss +3 -0
- package/src/components/vv-input-text.scss +3 -0
- package/src/components/vv-nav.scss +3 -0
- package/src/components/vv-progress.scss +3 -0
- package/src/components/vv-radio-group.scss +3 -0
- package/src/components/vv-radio.scss +3 -0
- package/src/components/vv-select.scss +3 -0
- package/src/components/vv-skeleton.scss +3 -0
- package/src/components/vv-tab.scss +3 -0
- package/src/components/vv-table.scss +3 -0
- package/src/components/vv-text.scss +3 -0
- package/src/components/vv-textarea.scss +3 -0
- package/src/components/vv-tooltip.scss +5 -7
- package/src/export.scss +0 -1
- package/src/props/background.scss +5 -3
- package/src/props/borders.scss +5 -3
- package/src/props/breakpoints.scss +11 -9
- package/src/props/colors.scss +4 -2
- package/src/props/effects.scss +5 -3
- package/src/props/filters.scss +6 -4
- package/src/props/input.scss +4 -2
- package/src/props/layout.scss +5 -3
- package/src/props/sizing.scss +5 -3
- package/src/props/spacing.scss +16 -16
- package/src/props/transitions.scss +150 -118
- package/src/props/typography.scss +24 -24
- package/src/reset.scss +4 -3
- package/src/settings/_colors.scss +80 -50
- package/src/settings/_effects.scss +7 -7
- package/src/settings/components/_vv-accordion.scss +2 -1
- package/src/settings/components/_vv-badge.scss +2 -10
- package/src/settings/components/_vv-button.scss +1 -1
- package/src/settings/components/_vv-card.scss +3 -17
- package/src/settings/components/_vv-nav.scss +1 -6
- package/src/settings/components/_vv-text.scss +1 -0
- package/src/themes/dark/components/_vv-alert.scss +14 -10
- package/src/themes/dark/components/_vv-avatar.scss +14 -10
- package/src/themes/dark/components/_vv-badge.scss +14 -10
- package/src/themes/dark/components/_vv-button.scss +14 -10
- package/src/themes/dark/components/_vv-dropdown-action.scss +14 -10
- package/src/themes/dark/components/_vv-dropdown-option.scss +14 -10
- package/src/themes/dark/components/_vv-nav.scss +14 -10
- package/src/themes/dark/components/_vv-select.scss +14 -10
- package/src/themes/dark/props/_background.scss +3 -0
- package/src/themes/dark/props/_colors.scss +3 -0
- package/src/themes/dark/props/_input.scss +3 -0
- package/src/themes/dark/settings/_colors.scss +42 -28
- package/src/themes/dark/settings/components/_vv-alert.scss +23 -0
- package/src/themes/dark/settings/components/_vv-avatar.scss +3 -0
- package/src/themes/dark/settings/components/_vv-button.scss +0 -1
- package/src/tools/_breakpoints.scss +20 -4
- package/src/tools/_functions.scss +157 -0
- package/src/tools/_mixins.scss +5 -1216
- package/src/tools/mixin-modules/_attrs.scss +178 -0
- package/src/tools/mixin-modules/_bem.scss +751 -0
- package/src/tools/mixin-modules/_helpers.scss +23 -0
- package/src/tools/mixin-modules/_index.scss +25 -0
- package/src/tools/mixin-modules/_layers.scss +42 -0
- package/src/tools/mixin-modules/_props.scss +41 -0
- package/src/tools/mixin-modules/_theme.scss +354 -0
- package/src/tools/mixin-modules/_utilities.scss +121 -0
- package/src/utilities/backgrounds.scss +3 -0
- package/src/utilities/borders.scss +3 -0
- package/src/utilities/colors.scss +3 -0
- package/src/utilities/effects.scss +3 -0
- package/src/utilities/filters.scss +3 -0
- package/src/utilities/flexbox.scss +3 -0
- package/src/utilities/grid.scss +3 -0
- package/src/utilities/interactivity.scss +3 -0
- package/src/utilities/layout.scss +3 -0
- package/src/utilities/sizing.scss +3 -0
- package/src/utilities/spacing.scss +3 -0
- package/src/utilities/tables.scss +3 -0
- package/src/utilities/transforms.scss +11 -6
- package/src/utilities/transitions.scss +3 -0
- package/src/utilities/typography.scss +3 -0
- package/src/volver.scss +2 -1
package/src/tools/_mixins.scss
CHANGED
|
@@ -1,1217 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
@use 'sass:selector';
|
|
6
|
-
@use 'sass:math';
|
|
7
|
-
@use 'functions' as *;
|
|
8
|
-
@use 'breakpoints' as *;
|
|
1
|
+
// ============================================
|
|
2
|
+
// Mixins
|
|
3
|
+
// Re-exports all mixins from the mixin-modules folder
|
|
4
|
+
// ============================================
|
|
9
5
|
|
|
10
|
-
|
|
11
|
-
@mixin spread-map-into-props($map: (), $prefix: '', $old-key: '', $deep: true) {
|
|
12
|
-
@each $key, $value in $map {
|
|
13
|
-
$name: meta.inspect($key);
|
|
14
|
-
|
|
15
|
-
@if $name == meta.inspect($old-key) {
|
|
16
|
-
$name: $prefix;
|
|
17
|
-
} @else if $prefix != '' and meta.inspect($prefix) != meta.inspect($key)
|
|
18
|
-
{
|
|
19
|
-
$name: $prefix + '-' + $key;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// fix name
|
|
23
|
-
$name: str-replace($name, '\\/', '-');
|
|
24
|
-
|
|
25
|
-
@if string.slice(meta.inspect($key), 1, 1) !=
|
|
26
|
-
'_' and
|
|
27
|
-
string.slice(meta.inspect($key), 1, 2) !=
|
|
28
|
-
'--' and
|
|
29
|
-
string.slice(meta.inspect($key), 1, 1) !=
|
|
30
|
-
'['
|
|
31
|
-
{
|
|
32
|
-
@if meta.type-of($value) == 'map' {
|
|
33
|
-
@if $deep {
|
|
34
|
-
@include spread-map-into-props($value, $name, $key);
|
|
35
|
-
}
|
|
36
|
-
} @else {
|
|
37
|
-
#{'--' + $name}: #{$value};
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Transform a map into a list of utilities
|
|
44
|
-
@mixin spread-map-into-utilities(
|
|
45
|
-
$map: (),
|
|
46
|
-
$class: '',
|
|
47
|
-
$attribute: '',
|
|
48
|
-
$prop: '',
|
|
49
|
-
$name: '',
|
|
50
|
-
$deep: true,
|
|
51
|
-
$bps: (
|
|
52
|
-
xxs: 0,
|
|
53
|
-
),
|
|
54
|
-
$prefix: '',
|
|
55
|
-
$zero-specificity: false
|
|
56
|
-
) {
|
|
57
|
-
@if (meta.type-of($map) == 'map' or meta.type-of($map) == 'list') and
|
|
58
|
-
$attribute !=
|
|
59
|
-
''
|
|
60
|
-
{
|
|
61
|
-
@each $breakpoint, $breakpoint-value in $bps {
|
|
62
|
-
@if $breakpoint-value > 0 {
|
|
63
|
-
$prefix: $breakpoint + '\\:';
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
@each $key, $value in $map {
|
|
67
|
-
@if $name != '' and meta.inspect($key) != meta.inspect($name) {
|
|
68
|
-
$key: #{$name}-#{meta.inspect($key)};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
@if meta.type-of($value) == 'map' and $deep {
|
|
72
|
-
@include spread-map-into-utilities(
|
|
73
|
-
$map: $value,
|
|
74
|
-
$class: $class,
|
|
75
|
-
$attribute: $attribute,
|
|
76
|
-
$prop: $prop,
|
|
77
|
-
$name: $key,
|
|
78
|
-
$bps: $bps,
|
|
79
|
-
$prefix: $prefix,
|
|
80
|
-
$zero-specificity: $zero-specificity
|
|
81
|
-
);
|
|
82
|
-
} @else {
|
|
83
|
-
$default: null;
|
|
84
|
-
$class-name: $class;
|
|
85
|
-
$key: meta.inspect($key);
|
|
86
|
-
$var: $prop;
|
|
87
|
-
|
|
88
|
-
// fix class name
|
|
89
|
-
@if $class-name != $key and $prop != $key {
|
|
90
|
-
@if $class-name != '' {
|
|
91
|
-
$class-name: $class-name + '-';
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
$class-name: $class-name + $key;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// fix variable name
|
|
98
|
-
@if $var != '' and $var != $key {
|
|
99
|
-
$var: $var + '-' + $key;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
$var: str-replace($var, '\\/', '-');
|
|
103
|
-
|
|
104
|
-
// check if value is not a map (spacing-dynamic)
|
|
105
|
-
@if meta.type-of($value) != 'map' {
|
|
106
|
-
$default: $value;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// check if map is a list
|
|
110
|
-
@if meta.type-of($map) ==
|
|
111
|
-
'list' and
|
|
112
|
-
(not $default or $default == '')
|
|
113
|
-
{
|
|
114
|
-
$default: $key;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
@if meta.type-of($default) == 'string' {
|
|
118
|
-
$default: string.unquote($default);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
%#{$prefix}#{$class-name} {
|
|
122
|
-
@include media-breakpoint-up($breakpoint, $bps) {
|
|
123
|
-
@if meta.type-of($attribute) != 'list' {
|
|
124
|
-
$attribute: ($attribute);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
@each $attr in $attribute {
|
|
128
|
-
@if $default {
|
|
129
|
-
@if $var != '' {
|
|
130
|
-
#{$attr}: var(--#{$var}, $default);
|
|
131
|
-
} @else {
|
|
132
|
-
#{$attr}: $default;
|
|
133
|
-
}
|
|
134
|
-
} @else if $var != '' {
|
|
135
|
-
#{$attr}: var(--#{$var});
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
@include wrap-with-where(
|
|
142
|
-
$selector: '.' + $prefix + $class-name,
|
|
143
|
-
$enabled: $zero-specificity
|
|
144
|
-
) {
|
|
145
|
-
@extend %#{$prefix}#{$class-name};
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
// Transform a map into a list of modifiers
|
|
154
|
-
@mixin spread-map-into-modifiers(
|
|
155
|
-
$original: null,
|
|
156
|
-
$map: (),
|
|
157
|
-
$prefix: '',
|
|
158
|
-
$key: 'modifier',
|
|
159
|
-
$block: null,
|
|
160
|
-
$modifier: '',
|
|
161
|
-
$props: true,
|
|
162
|
-
$zero-specificity: true,
|
|
163
|
-
$bps: (
|
|
164
|
-
xxs: 0,
|
|
165
|
-
)
|
|
166
|
-
) {
|
|
167
|
-
@if not $original {
|
|
168
|
-
$original: $map;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
@if not $block {
|
|
172
|
-
$block: &;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
@if meta.type-of(map.get($map, $key)) == 'map' {
|
|
176
|
-
@each $item, $value in map.get($map, $key) {
|
|
177
|
-
$selector: $block + '--' + $item;
|
|
178
|
-
|
|
179
|
-
%#{$prefix + '--' + $item} {
|
|
180
|
-
@include spread-map-into-attrs(
|
|
181
|
-
$original: $original,
|
|
182
|
-
$map: $value,
|
|
183
|
-
$prefix: $prefix,
|
|
184
|
-
$variant: #{$key}-#{$item},
|
|
185
|
-
$deep: true,
|
|
186
|
-
$ignore: (
|
|
187
|
-
'state',
|
|
188
|
-
'breakpoint',
|
|
189
|
-
'element',
|
|
190
|
-
'modifier',
|
|
191
|
-
),
|
|
192
|
-
$props: $props
|
|
193
|
-
);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
// map props and attributes
|
|
197
|
-
@include wrap-with-where(
|
|
198
|
-
$selector: $modifier + $selector + $block,
|
|
199
|
-
$enabled: $zero-specificity
|
|
200
|
-
) {
|
|
201
|
-
@extend %#{$prefix + '--' + $item};
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// map elements
|
|
205
|
-
@if map.get($value, 'element') {
|
|
206
|
-
@include spread-map-into-elements(
|
|
207
|
-
$original: $original,
|
|
208
|
-
$map: $value,
|
|
209
|
-
$prefix: #{$prefix}-#{$key}-#{$item},
|
|
210
|
-
$key: 'element',
|
|
211
|
-
$block: $block,
|
|
212
|
-
$modifier: $modifier + $selector,
|
|
213
|
-
$props: $props,
|
|
214
|
-
$zero-specificity: $zero-specificity,
|
|
215
|
-
$bps: $bps
|
|
216
|
-
);
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
// map states
|
|
220
|
-
@if map.get($value, 'state') {
|
|
221
|
-
@include spread-map-into-states(
|
|
222
|
-
$original: $original,
|
|
223
|
-
$map: $value,
|
|
224
|
-
$prefix: #{$prefix}-#{$key}-#{$item},
|
|
225
|
-
$key: 'state',
|
|
226
|
-
$block: $block,
|
|
227
|
-
$modifier: $modifier + $selector,
|
|
228
|
-
$props: $props,
|
|
229
|
-
$zero-specificity: $zero-specificity,
|
|
230
|
-
$bps: $bps
|
|
231
|
-
);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
// map breakpoints
|
|
235
|
-
@if map.get($value, 'breakpoint') {
|
|
236
|
-
@include spread-map-into-breakpoints(
|
|
237
|
-
$map: $value,
|
|
238
|
-
$prefix: #{$prefix}-#{$key}-#{$item},
|
|
239
|
-
$key: 'breakpoint',
|
|
240
|
-
$block: $block,
|
|
241
|
-
$modifier: $modifier + $selector,
|
|
242
|
-
$props: $props,
|
|
243
|
-
$zero-specificity: $zero-specificity,
|
|
244
|
-
$bps: $bps
|
|
245
|
-
);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
// map modifiers
|
|
249
|
-
@if map.get($value, 'modifier') {
|
|
250
|
-
@include spread-map-into-modifiers(
|
|
251
|
-
$original: $original,
|
|
252
|
-
$map: $value,
|
|
253
|
-
$prefix: #{$prefix}-#{$key}-#{$item},
|
|
254
|
-
$key: 'modifier',
|
|
255
|
-
$block: $block,
|
|
256
|
-
$modifier: $modifier + $selector,
|
|
257
|
-
$props: $props,
|
|
258
|
-
$zero-specificity: $zero-specificity,
|
|
259
|
-
$bps: $bps
|
|
260
|
-
);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
// Transform a map into a list of BEM elements
|
|
267
|
-
@mixin spread-map-into-elements(
|
|
268
|
-
$original: (),
|
|
269
|
-
$map: (),
|
|
270
|
-
$prefix: '',
|
|
271
|
-
$key: 'element',
|
|
272
|
-
$block: null,
|
|
273
|
-
$modifier: null,
|
|
274
|
-
$props: true,
|
|
275
|
-
$zero-specificity: true,
|
|
276
|
-
$bps: (
|
|
277
|
-
xxs: 0,
|
|
278
|
-
)
|
|
279
|
-
) {
|
|
280
|
-
@if not $block {
|
|
281
|
-
$block: &;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
@if meta.type-of(map.get($map, $key)) == 'map' {
|
|
285
|
-
@each $element, $value in map.get($map, $key) {
|
|
286
|
-
$selector: $block + '__' + $element;
|
|
287
|
-
|
|
288
|
-
// combinator
|
|
289
|
-
$combinator: map.get($value, '_combinator');
|
|
290
|
-
|
|
291
|
-
@if not $combinator {
|
|
292
|
-
$combinator: map.get($original, $key, $element, '_combinator');
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
@if $modifier {
|
|
296
|
-
$selectors: ();
|
|
297
|
-
|
|
298
|
-
@each $item in selector.parse($modifier) {
|
|
299
|
-
@if $combinator {
|
|
300
|
-
$item: '#{$item} #{$combinator}';
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
$selectors: list.join(
|
|
304
|
-
$selectors,
|
|
305
|
-
selector.nest($item, $selector)
|
|
306
|
-
);
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
$selector: list-to-string($selectors);
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
// alias
|
|
313
|
-
$alias: map.get($value, '_alias');
|
|
314
|
-
|
|
315
|
-
@if not $alias {
|
|
316
|
-
$alias: map.get($original, $key, $element, '_alias');
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
@if $alias {
|
|
320
|
-
@if $modifier {
|
|
321
|
-
$aliases: ();
|
|
322
|
-
|
|
323
|
-
@each $item in selector.parse($modifier) {
|
|
324
|
-
$aliases: list.join(
|
|
325
|
-
$aliases,
|
|
326
|
-
selector.nest($item, $alias)
|
|
327
|
-
);
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
$alias: list-to-string($aliases);
|
|
331
|
-
} @else {
|
|
332
|
-
$alias: $block + ' ' + $alias;
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
%#{$prefix + '__' + $element} {
|
|
337
|
-
@include spread-map-into-attrs(
|
|
338
|
-
$map: $value,
|
|
339
|
-
$prefix: $prefix,
|
|
340
|
-
$variant: #{$key}-#{$element},
|
|
341
|
-
$deep: true,
|
|
342
|
-
$ignore: (
|
|
343
|
-
'state',
|
|
344
|
-
'breakpoint',
|
|
345
|
-
),
|
|
346
|
-
$props: $props
|
|
347
|
-
);
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
// attributes
|
|
351
|
-
@include wrap-with-where(
|
|
352
|
-
$selector: list-to-string(($selector, $alias)),
|
|
353
|
-
$enabled: $zero-specificity
|
|
354
|
-
) {
|
|
355
|
-
@extend %#{$prefix + '__' + $element};
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
// states
|
|
359
|
-
@if map.get($value, 'state') {
|
|
360
|
-
@include spread-map-into-states(
|
|
361
|
-
$map: $value,
|
|
362
|
-
$prefix: #{$prefix}-#{$key}-#{$element},
|
|
363
|
-
$key: 'state',
|
|
364
|
-
$block: $selector,
|
|
365
|
-
$alias: $alias,
|
|
366
|
-
$props: $props,
|
|
367
|
-
$zero-specificity: $zero-specificity,
|
|
368
|
-
$bps: $bps
|
|
369
|
-
);
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
// breakpoints
|
|
373
|
-
@if map.get($value, 'breakpoint') {
|
|
374
|
-
@include spread-map-into-breakpoints(
|
|
375
|
-
$map: $value,
|
|
376
|
-
$prefix: #{$prefix}-#{$key}-#{$element},
|
|
377
|
-
$key: 'breakpoint',
|
|
378
|
-
$block: list-to-string(($selector, $alias)),
|
|
379
|
-
$props: $props,
|
|
380
|
-
$zero-specificity: $zero-specificity,
|
|
381
|
-
$bps: $bps
|
|
382
|
-
);
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
// Transform a map into a list of states
|
|
389
|
-
@mixin spread-map-into-states(
|
|
390
|
-
$original: null,
|
|
391
|
-
$map: (),
|
|
392
|
-
$prefix: '',
|
|
393
|
-
$key: 'state',
|
|
394
|
-
$block: null,
|
|
395
|
-
$modifier: '',
|
|
396
|
-
$alias: null,
|
|
397
|
-
$props: true,
|
|
398
|
-
$zero-specificity: true,
|
|
399
|
-
$bps: (
|
|
400
|
-
xxs: 0,
|
|
401
|
-
)
|
|
402
|
-
) {
|
|
403
|
-
@if not $original {
|
|
404
|
-
$original: $map;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
@if not $block {
|
|
408
|
-
$blocks: &;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
@if meta.type-of(map.get($map, $key)) == 'map' {
|
|
412
|
-
@each $state, $value in map.get($map, $key) {
|
|
413
|
-
@if list.index(
|
|
414
|
-
(
|
|
415
|
-
active,
|
|
416
|
-
focus,
|
|
417
|
-
hover,
|
|
418
|
-
focus-within,
|
|
419
|
-
target,
|
|
420
|
-
visited,
|
|
421
|
-
focus-visible,
|
|
422
|
-
disabled,
|
|
423
|
-
checked,
|
|
424
|
-
checked-within,
|
|
425
|
-
multiple,
|
|
426
|
-
selected,
|
|
427
|
-
readonly,
|
|
428
|
-
empty,
|
|
429
|
-
placeholder-shown,
|
|
430
|
-
dirty,
|
|
431
|
-
valid,
|
|
432
|
-
invalid,
|
|
433
|
-
indeterminate,
|
|
434
|
-
first-child,
|
|
435
|
-
last-child,
|
|
436
|
-
open,
|
|
437
|
-
close,
|
|
438
|
-
determinate,
|
|
439
|
-
indeterminate,
|
|
440
|
-
pressed,
|
|
441
|
-
current
|
|
442
|
-
),
|
|
443
|
-
$state
|
|
444
|
-
)
|
|
445
|
-
{
|
|
446
|
-
$selectors: ();
|
|
447
|
-
|
|
448
|
-
@each $block-item in selector.parse($block) {
|
|
449
|
-
$selectors: list.join(
|
|
450
|
-
$selectors,
|
|
451
|
-
(
|
|
452
|
-
'#{$modifier}#{$block-item}--#{$state}',
|
|
453
|
-
'#{$modifier}#{$block-item}.#{$state}'
|
|
454
|
-
)
|
|
455
|
-
);
|
|
456
|
-
|
|
457
|
-
@if $alias {
|
|
458
|
-
$selectors: list.join(
|
|
459
|
-
$selectors,
|
|
460
|
-
'#{$modifier}#{$alias}.#{$state}'
|
|
461
|
-
);
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
@if $state == 'checked-within' {
|
|
465
|
-
$selectors: list.join(
|
|
466
|
-
$selectors,
|
|
467
|
-
'#{$modifier}#{$block-item}:has(input:checked)'
|
|
468
|
-
);
|
|
469
|
-
|
|
470
|
-
@if $alias {
|
|
471
|
-
$selectors: list.join(
|
|
472
|
-
$selectors,
|
|
473
|
-
'#{$modifier}#{$alias}:has(input:checked)'
|
|
474
|
-
);
|
|
475
|
-
}
|
|
476
|
-
} @else if $state == 'open' {
|
|
477
|
-
$selectors: list.join(
|
|
478
|
-
$selectors,
|
|
479
|
-
'#{$modifier}#{$block-item}[open]'
|
|
480
|
-
);
|
|
481
|
-
|
|
482
|
-
@if $alias {
|
|
483
|
-
$selectors: list.join(
|
|
484
|
-
$selectors,
|
|
485
|
-
'#{$modifier}#{$alias}[open]'
|
|
486
|
-
);
|
|
487
|
-
}
|
|
488
|
-
} @else if $state == 'close' {
|
|
489
|
-
$selectors: list.join(
|
|
490
|
-
$selectors,
|
|
491
|
-
'#{$modifier}#{$block-item}:not([open])'
|
|
492
|
-
);
|
|
493
|
-
|
|
494
|
-
@if $alias {
|
|
495
|
-
$selectors: list.join(
|
|
496
|
-
$selectors,
|
|
497
|
-
'#{$modifier}#{$alias}:not([open])'
|
|
498
|
-
);
|
|
499
|
-
}
|
|
500
|
-
} @else if $state == 'dirty' {
|
|
501
|
-
$selectors: list.join(
|
|
502
|
-
$selectors,
|
|
503
|
-
'#{$modifier}#{$block-item}:not(:has(*:placeholder-shown))'
|
|
504
|
-
);
|
|
505
|
-
|
|
506
|
-
@if $alias {
|
|
507
|
-
$selectors: list.join(
|
|
508
|
-
$selectors,
|
|
509
|
-
'#{$modifier}#{$alias}:not(:has(*:placeholder-shown))'
|
|
510
|
-
);
|
|
511
|
-
}
|
|
512
|
-
} @else if
|
|
513
|
-
$state ==
|
|
514
|
-
'disabled' or
|
|
515
|
-
$state ==
|
|
516
|
-
'readonly' or
|
|
517
|
-
$state ==
|
|
518
|
-
'multiple'
|
|
519
|
-
{
|
|
520
|
-
$selectors: list.join(
|
|
521
|
-
$selectors,
|
|
522
|
-
'#{$modifier}#{$block-item}[#{$state}]'
|
|
523
|
-
);
|
|
524
|
-
|
|
525
|
-
@if $alias {
|
|
526
|
-
$selectors: list.join(
|
|
527
|
-
$selectors,
|
|
528
|
-
'#{$modifier}#{$alias}[#{$state}]'
|
|
529
|
-
);
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
@if $state == 'disabled' {
|
|
533
|
-
$selectors: list.join(
|
|
534
|
-
$selectors,
|
|
535
|
-
'#{$modifier}#{$block-item}[aria-disabled="true"]'
|
|
536
|
-
);
|
|
537
|
-
|
|
538
|
-
@if $alias {
|
|
539
|
-
$selectors: list.join(
|
|
540
|
-
$selectors,
|
|
541
|
-
'#{$modifier}#{$alias}[aria-disabled="true"]'
|
|
542
|
-
);
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
} @else if $state == 'focus-visible' {
|
|
546
|
-
$selectors: list.join(
|
|
547
|
-
$selectors,
|
|
548
|
-
'#{$modifier}#{$block-item}:not(:active):not([disabled]):not([tabindex="-1"]:not([aria-disabled="true"])):#{$state}'
|
|
549
|
-
);
|
|
550
|
-
|
|
551
|
-
@if $alias {
|
|
552
|
-
$selectors: list.join(
|
|
553
|
-
$selectors,
|
|
554
|
-
'#{$modifier}#{$alias}:not(:active):not([disabled]):not([tabindex="-1"]:not([aria-disabled="true"])):#{$state}'
|
|
555
|
-
);
|
|
556
|
-
}
|
|
557
|
-
} @else if $state == 'checked' {
|
|
558
|
-
$selectors: list.join(
|
|
559
|
-
$selectors,
|
|
560
|
-
'#{$modifier}#{$block-item}:#{$state}'
|
|
561
|
-
);
|
|
562
|
-
|
|
563
|
-
@if $alias {
|
|
564
|
-
$selectors: list.join(
|
|
565
|
-
$selectors,
|
|
566
|
-
'#{$modifier}#{$alias}:#{$state}'
|
|
567
|
-
);
|
|
568
|
-
}
|
|
569
|
-
} @else if $state == 'pressed' {
|
|
570
|
-
$selectors: list.join(
|
|
571
|
-
$selectors,
|
|
572
|
-
'#{$modifier}#{$block-item}[aria-pressed="true"]'
|
|
573
|
-
);
|
|
574
|
-
|
|
575
|
-
@if $alias {
|
|
576
|
-
$selectors: list.join(
|
|
577
|
-
$selectors,
|
|
578
|
-
'#{$modifier}#{$alias}[aria-pressed="true"]'
|
|
579
|
-
);
|
|
580
|
-
}
|
|
581
|
-
} @else if $state == 'selected' {
|
|
582
|
-
$selectors: list.join(
|
|
583
|
-
$selectors,
|
|
584
|
-
'#{$modifier}#{$block-item}[aria-selected="true"]'
|
|
585
|
-
);
|
|
586
|
-
|
|
587
|
-
@if $alias {
|
|
588
|
-
$selectors: list.join(
|
|
589
|
-
$selectors,
|
|
590
|
-
'#{$modifier}#{$alias}[aria-selected="true"]'
|
|
591
|
-
);
|
|
592
|
-
}
|
|
593
|
-
} @else if $state != 'current' {
|
|
594
|
-
$selectors: list.join(
|
|
595
|
-
$selectors,
|
|
596
|
-
'#{$modifier}#{$block-item}:not([disabled]):#{$state}'
|
|
597
|
-
);
|
|
598
|
-
|
|
599
|
-
@if $alias {
|
|
600
|
-
$selectors: list.join(
|
|
601
|
-
$selectors,
|
|
602
|
-
'#{$modifier}#{$alias}:not([disabled]):#{$state}'
|
|
603
|
-
);
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
$selector: list-to-string($selectors);
|
|
609
|
-
|
|
610
|
-
%#{$prefix + '--' + $state} {
|
|
611
|
-
@include spread-map-into-attrs(
|
|
612
|
-
$original: $original,
|
|
613
|
-
$map: $value,
|
|
614
|
-
$prefix: $prefix,
|
|
615
|
-
$variant: #{$key}-#{$state},
|
|
616
|
-
$ignore: (
|
|
617
|
-
'element',
|
|
618
|
-
),
|
|
619
|
-
$deep: true,
|
|
620
|
-
$props: $props
|
|
621
|
-
);
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
@include wrap-with-where(
|
|
625
|
-
$selector: $selector,
|
|
626
|
-
$enabled: $zero-specificity
|
|
627
|
-
) {
|
|
628
|
-
@extend %#{$prefix + '--' + $state};
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
// map elements
|
|
632
|
-
@if map.get($value, 'element') {
|
|
633
|
-
@include spread-map-into-elements(
|
|
634
|
-
$original: $original,
|
|
635
|
-
$map: $value,
|
|
636
|
-
$prefix: #{$prefix}-#{$key}-#{$state},
|
|
637
|
-
$key: 'element',
|
|
638
|
-
$block: $block,
|
|
639
|
-
$modifier: $selector,
|
|
640
|
-
$props: $props,
|
|
641
|
-
$zero-specificity: $zero-specificity,
|
|
642
|
-
$bps: $bps
|
|
643
|
-
);
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
// breakpoints
|
|
647
|
-
@if map.get($value, 'breakpoint') {
|
|
648
|
-
@include spread-map-into-breakpoints(
|
|
649
|
-
$original: $original,
|
|
650
|
-
$map: $value,
|
|
651
|
-
$prefix: #{$prefix}-#{$key}-#{$state},
|
|
652
|
-
$key: 'breakpoint',
|
|
653
|
-
$block: $block,
|
|
654
|
-
$modifier: $selector,
|
|
655
|
-
$props: $props,
|
|
656
|
-
$zero-specificity: $zero-specificity,
|
|
657
|
-
$bps: $bps
|
|
658
|
-
);
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
// Transform a map into a list of breakpoints
|
|
666
|
-
@mixin spread-map-into-breakpoints(
|
|
667
|
-
$original: null,
|
|
668
|
-
$map: (),
|
|
669
|
-
$prefix: '',
|
|
670
|
-
$key: 'breakpoint',
|
|
671
|
-
$block: null,
|
|
672
|
-
$modifier: '',
|
|
673
|
-
$props: true,
|
|
674
|
-
$zero-specificity: true,
|
|
675
|
-
$bps: (
|
|
676
|
-
xxs: 0,
|
|
677
|
-
)
|
|
678
|
-
) {
|
|
679
|
-
@if not $original {
|
|
680
|
-
$original: $map;
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
@if not $block {
|
|
684
|
-
$block: &;
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
@if meta.type-of(map.get($map, $key)) == 'map' {
|
|
688
|
-
@each $breakpoint, $value in map.get($map, $key) {
|
|
689
|
-
@if string.index($breakpoint, '-') {
|
|
690
|
-
$operator: list.nth(string.split($breakpoint, '-'), 1);
|
|
691
|
-
$bp: list.nth(string.split($breakpoint, '-'), 2);
|
|
692
|
-
|
|
693
|
-
@if map.has-key($bps, $bp) {
|
|
694
|
-
@if $operator == 'up' {
|
|
695
|
-
@include wrap-with-where(
|
|
696
|
-
$selector: '#{$modifier}#{$block}',
|
|
697
|
-
$enabled: $zero-specificity
|
|
698
|
-
) {
|
|
699
|
-
@include media-breakpoint-up($bp, $bps) {
|
|
700
|
-
@include spread-map-into-attrs(
|
|
701
|
-
$original: $original,
|
|
702
|
-
$map: $value,
|
|
703
|
-
$prefix: $prefix,
|
|
704
|
-
$variant: #{$key}-#{$breakpoint},
|
|
705
|
-
$deep: true,
|
|
706
|
-
$props: $props
|
|
707
|
-
);
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
@if $operator == 'down' {
|
|
713
|
-
@include wrap-with-where(
|
|
714
|
-
$selector: '#{$modifier}#{$block}',
|
|
715
|
-
$enabled: $zero-specificity
|
|
716
|
-
) {
|
|
717
|
-
@include media-breakpoint-down($bp, $bps) {
|
|
718
|
-
@include spread-map-into-attrs(
|
|
719
|
-
$original: $original,
|
|
720
|
-
$map: $value,
|
|
721
|
-
$prefix: $prefix,
|
|
722
|
-
$variant: #{$key}-#{$breakpoint},
|
|
723
|
-
$deep: true,
|
|
724
|
-
$props: $props
|
|
725
|
-
);
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
@if map.has-key($bps, $operator) {
|
|
731
|
-
@include wrap-with-where(
|
|
732
|
-
$selector: '#{$modifier}#{$block}',
|
|
733
|
-
$enabled: $zero-specificity
|
|
734
|
-
) {
|
|
735
|
-
@include media-breakpoint-between(
|
|
736
|
-
$operator,
|
|
737
|
-
$bp,
|
|
738
|
-
$bps
|
|
739
|
-
) {
|
|
740
|
-
@include spread-map-into-attrs(
|
|
741
|
-
$original: $original,
|
|
742
|
-
$map: $value,
|
|
743
|
-
$prefix: $prefix,
|
|
744
|
-
$variant: #{$key}-#{$breakpoint},
|
|
745
|
-
$deep: true,
|
|
746
|
-
$props: $props
|
|
747
|
-
);
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
} @else if map.has-key($bps, $breakpoint) {
|
|
753
|
-
@include wrap-with-where(
|
|
754
|
-
$selector: '#{$modifier}#{$block}',
|
|
755
|
-
$enabled: $zero-specificity
|
|
756
|
-
) {
|
|
757
|
-
@include media-breakpoint-up($breakpoint, $bps) {
|
|
758
|
-
@include spread-map-into-attrs(
|
|
759
|
-
$original: $original,
|
|
760
|
-
$map: $value,
|
|
761
|
-
$prefix: $prefix,
|
|
762
|
-
$variant: #{$key}-#{$breakpoint},
|
|
763
|
-
$deep: true,
|
|
764
|
-
$props: $props
|
|
765
|
-
);
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
@mixin pseudo-element-placehoder($pseudo-element) {
|
|
774
|
-
@if list.index(
|
|
775
|
-
(
|
|
776
|
-
calendar-picker-indicator,
|
|
777
|
-
search-cancel-button,
|
|
778
|
-
color-swatch-wrapper,
|
|
779
|
-
color-swatch,
|
|
780
|
-
inner-spin-button,
|
|
781
|
-
outer-spin-button,
|
|
782
|
-
progress-bar,
|
|
783
|
-
progress-value,
|
|
784
|
-
progress-inner-element,
|
|
785
|
-
datetime-edit,
|
|
786
|
-
datetime-edit-fields-wrapper,
|
|
787
|
-
datetime-edit-day-field
|
|
788
|
-
),
|
|
789
|
-
$pseudo-element
|
|
790
|
-
)
|
|
791
|
-
{
|
|
792
|
-
&::-webkit-#{$pseudo-element} {
|
|
793
|
-
@content;
|
|
794
|
-
}
|
|
795
|
-
&::-moz-#{$pseudo-element} {
|
|
796
|
-
@content;
|
|
797
|
-
}
|
|
798
|
-
} @else {
|
|
799
|
-
&::#{$pseudo-element} {
|
|
800
|
-
@content;
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
// Transform a map into a list of CSS attributes
|
|
806
|
-
@mixin spread-map-into-attrs(
|
|
807
|
-
$original: (),
|
|
808
|
-
$map: (),
|
|
809
|
-
$prefix: '',
|
|
810
|
-
$variant: '',
|
|
811
|
-
$postfix: '',
|
|
812
|
-
$deep: false,
|
|
813
|
-
$ignore: (),
|
|
814
|
-
$props: true,
|
|
815
|
-
$bps: (
|
|
816
|
-
xxs: 0,
|
|
817
|
-
)
|
|
818
|
-
) {
|
|
819
|
-
@if meta.type-of($map) == 'map' and $prefix != '' {
|
|
820
|
-
@each $key, $value in $map {
|
|
821
|
-
@if not list.index($ignore, $key) {
|
|
822
|
-
@if meta.type-of($value) ==
|
|
823
|
-
'map' and
|
|
824
|
-
($deep or $key == 'pseudo')
|
|
825
|
-
{
|
|
826
|
-
$original: map.get($original, $key);
|
|
827
|
-
|
|
828
|
-
@if not $original {
|
|
829
|
-
$original: ();
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
@if $postfix != '' {
|
|
833
|
-
$key: #{$postfix}-#{$key};
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
@if $key == 'pseudo' {
|
|
837
|
-
@each $pseudo-element, $pseudo-map in $value {
|
|
838
|
-
@if meta.type-of($pseudo-map) == 'map' {
|
|
839
|
-
@if list.index(
|
|
840
|
-
(
|
|
841
|
-
before,
|
|
842
|
-
after,
|
|
843
|
-
placeholder,
|
|
844
|
-
calendar-picker-indicator,
|
|
845
|
-
search-cancel-button,
|
|
846
|
-
color-swatch-wrapper,
|
|
847
|
-
color-swatch,
|
|
848
|
-
inner-spin-button,
|
|
849
|
-
outer-spin-button,
|
|
850
|
-
progress-bar,
|
|
851
|
-
progress-value,
|
|
852
|
-
inner-element,
|
|
853
|
-
marker,
|
|
854
|
-
datetime-edit,
|
|
855
|
-
datetime-edit-fields-wrapper,
|
|
856
|
-
datetime-edit-day-field,
|
|
857
|
-
backdrop,
|
|
858
|
-
file-selector-button,
|
|
859
|
-
-webkit-progress-bar,
|
|
860
|
-
-webkit-progress-value,
|
|
861
|
-
-webkit-inner-element,
|
|
862
|
-
-moz-progress-bar,
|
|
863
|
-
-moz-progress-value,
|
|
864
|
-
-moz-inner-element,
|
|
865
|
-
-webkit-details-marker,
|
|
866
|
-
-webkit-scrollbar,
|
|
867
|
-
-webkit-scrollbar-track,
|
|
868
|
-
-webkit-scrollbar-thumb
|
|
869
|
-
),
|
|
870
|
-
$pseudo-element
|
|
871
|
-
)
|
|
872
|
-
{
|
|
873
|
-
$original: map.get(
|
|
874
|
-
$original,
|
|
875
|
-
$pseudo-element
|
|
876
|
-
);
|
|
877
|
-
$key: pseudo-#{$pseudo-element};
|
|
878
|
-
|
|
879
|
-
@include pseudo-element-placehoder(
|
|
880
|
-
$pseudo-element
|
|
881
|
-
) {
|
|
882
|
-
@if not $original {
|
|
883
|
-
@if not(
|
|
884
|
-
map.has-key(
|
|
885
|
-
$pseudo-map,
|
|
886
|
-
'content'
|
|
887
|
-
)
|
|
888
|
-
)
|
|
889
|
-
{
|
|
890
|
-
content: '';
|
|
891
|
-
}
|
|
892
|
-
|
|
893
|
-
$original: ();
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
@include spread-map-into-attrs(
|
|
897
|
-
$original: $original,
|
|
898
|
-
$map: $pseudo-map,
|
|
899
|
-
$prefix: $prefix,
|
|
900
|
-
$variant: $variant,
|
|
901
|
-
$postfix: $key,
|
|
902
|
-
$deep: true,
|
|
903
|
-
$props: $props
|
|
904
|
-
);
|
|
905
|
-
}
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
} @else {
|
|
910
|
-
@include spread-map-into-attrs(
|
|
911
|
-
$original: $original,
|
|
912
|
-
$map: $value,
|
|
913
|
-
$prefix: $prefix,
|
|
914
|
-
$variant: $variant,
|
|
915
|
-
$postfix: $key,
|
|
916
|
-
$deep: true,
|
|
917
|
-
$props: $props
|
|
918
|
-
);
|
|
919
|
-
}
|
|
920
|
-
} @else if
|
|
921
|
-
meta.type-of($value) !=
|
|
922
|
-
'map' and
|
|
923
|
-
(string.slice(meta.inspect($key), 1, 1) != '_')
|
|
924
|
-
{
|
|
925
|
-
@if $props and
|
|
926
|
-
$key !=
|
|
927
|
-
'content' and
|
|
928
|
-
(string.slice(meta.inspect($key), 1, 2) != '--') and
|
|
929
|
-
(string.slice(meta.inspect($key), 1, 1) != '[')
|
|
930
|
-
{
|
|
931
|
-
$prop-to-replace: --#{$prefix};
|
|
932
|
-
$prop-to-replace-with: --#{$prefix};
|
|
933
|
-
|
|
934
|
-
// add variant
|
|
935
|
-
@if $variant != '' {
|
|
936
|
-
$prop-to-replace-with: #{$prop-to-replace-with}-#{$variant};
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
// add postfix
|
|
940
|
-
@if $postfix != '' {
|
|
941
|
-
$prop-to-replace: #{$prop-to-replace}-#{$postfix};
|
|
942
|
-
$prop-to-replace-with: #{$prop-to-replace-with}-#{$postfix};
|
|
943
|
-
}
|
|
944
|
-
|
|
945
|
-
// add key
|
|
946
|
-
$prop-to-replace: #{$prop-to-replace}-#{$key};
|
|
947
|
-
$prop-to-replace-with: #{$prop-to-replace-with}-#{$key};
|
|
948
|
-
|
|
949
|
-
@if map.get($original, $key) {
|
|
950
|
-
#{$prop-to-replace}: var(#{$prop-to-replace-with});
|
|
951
|
-
} @else {
|
|
952
|
-
#{$key}: var(#{$prop-to-replace-with});
|
|
953
|
-
}
|
|
954
|
-
} @else {
|
|
955
|
-
@if string.slice(meta.inspect($key), 1, 1) == '[' {
|
|
956
|
-
$key: string.slice(
|
|
957
|
-
meta.inspect($key),
|
|
958
|
-
2,
|
|
959
|
-
string.length(meta.inspect($key)) - 1
|
|
960
|
-
);
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
#{$key}: $value;
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
}
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
// Wrap selector with :where()
|
|
972
|
-
@mixin wrap-with-where($selector, $enabled: true) {
|
|
973
|
-
@if meta.type-of($selector) == 'map' or meta.type-of($selector) == 'list' {
|
|
974
|
-
$selector: #{$selector};
|
|
975
|
-
}
|
|
976
|
-
|
|
977
|
-
@if $enabled {
|
|
978
|
-
$selector: ':where(#{string.unquote($selector)})';
|
|
979
|
-
}
|
|
980
|
-
|
|
981
|
-
#{$selector} {
|
|
982
|
-
@content;
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
|
|
986
|
-
// Transform a map into a BEM component
|
|
987
|
-
@mixin spread-map-into-bem(
|
|
988
|
-
$map,
|
|
989
|
-
$block: '',
|
|
990
|
-
$elements-key: 'element',
|
|
991
|
-
$modifiers-key: 'modifier',
|
|
992
|
-
$states-key: 'state',
|
|
993
|
-
$breakpoints-key: 'breakpoint',
|
|
994
|
-
$transitions-key: 'transition',
|
|
995
|
-
$props: true,
|
|
996
|
-
$zero-specificity: true,
|
|
997
|
-
$custom-props: false,
|
|
998
|
-
$custom-block: false,
|
|
999
|
-
$custom-elements: false,
|
|
1000
|
-
$custom-modifiers: false,
|
|
1001
|
-
$custom-states: false,
|
|
1002
|
-
$custom-breakpoints: false,
|
|
1003
|
-
$custom-transitions: false,
|
|
1004
|
-
$bps: (xxs: 0)
|
|
1005
|
-
) {
|
|
1006
|
-
@if meta.type-of($map) == 'map' and $block != '' {
|
|
1007
|
-
$selector: '.' + $block;
|
|
1008
|
-
|
|
1009
|
-
// custom props
|
|
1010
|
-
@if not $custom-props {
|
|
1011
|
-
@if $props {
|
|
1012
|
-
:where(:host, :root, .theme) {
|
|
1013
|
-
@include spread-map-into-props(
|
|
1014
|
-
$map: $map,
|
|
1015
|
-
$prefix: $block,
|
|
1016
|
-
$deep: true
|
|
1017
|
-
);
|
|
1018
|
-
}
|
|
1019
|
-
}
|
|
1020
|
-
}
|
|
1021
|
-
|
|
1022
|
-
// block
|
|
1023
|
-
@if not $custom-block {
|
|
1024
|
-
%#{$block} {
|
|
1025
|
-
@include spread-map-into-attrs(
|
|
1026
|
-
$map: $map,
|
|
1027
|
-
$prefix: $block,
|
|
1028
|
-
$props: $props
|
|
1029
|
-
);
|
|
1030
|
-
|
|
1031
|
-
// content
|
|
1032
|
-
@content;
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
|
-
@include wrap-with-where(
|
|
1036
|
-
$selector: $selector,
|
|
1037
|
-
$enabled: $zero-specificity
|
|
1038
|
-
) {
|
|
1039
|
-
@extend %#{$block};
|
|
1040
|
-
}
|
|
1041
|
-
} @else {
|
|
1042
|
-
// content
|
|
1043
|
-
@content;
|
|
1044
|
-
}
|
|
1045
|
-
|
|
1046
|
-
// elements
|
|
1047
|
-
@if not $custom-elements {
|
|
1048
|
-
@if map.has-key($map, $elements-key) {
|
|
1049
|
-
@include spread-map-into-elements(
|
|
1050
|
-
$map: $map,
|
|
1051
|
-
$prefix: $block,
|
|
1052
|
-
$key: $elements-key,
|
|
1053
|
-
$block: $selector,
|
|
1054
|
-
$props: $props,
|
|
1055
|
-
$zero-specificity: $zero-specificity,
|
|
1056
|
-
$bps: $bps
|
|
1057
|
-
);
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
|
|
1061
|
-
// states
|
|
1062
|
-
@if not $custom-states {
|
|
1063
|
-
@if map.has-key($map, $states-key) {
|
|
1064
|
-
@include spread-map-into-states(
|
|
1065
|
-
$map: $map,
|
|
1066
|
-
$prefix: $block,
|
|
1067
|
-
$key: $states-key,
|
|
1068
|
-
$block: $selector,
|
|
1069
|
-
$props: $props,
|
|
1070
|
-
$zero-specificity: $zero-specificity,
|
|
1071
|
-
$bps: $bps
|
|
1072
|
-
);
|
|
1073
|
-
}
|
|
1074
|
-
}
|
|
1075
|
-
|
|
1076
|
-
// modifiers
|
|
1077
|
-
@if not $custom-modifiers {
|
|
1078
|
-
@if map.has-key($map, $modifiers-key) {
|
|
1079
|
-
@include spread-map-into-modifiers(
|
|
1080
|
-
$map: $map,
|
|
1081
|
-
$prefix: $block,
|
|
1082
|
-
$key: $modifiers-key,
|
|
1083
|
-
$block: $selector,
|
|
1084
|
-
$props: $props,
|
|
1085
|
-
$zero-specificity: $zero-specificity,
|
|
1086
|
-
$bps: $bps
|
|
1087
|
-
);
|
|
1088
|
-
}
|
|
1089
|
-
}
|
|
1090
|
-
|
|
1091
|
-
// transition
|
|
1092
|
-
@if not $custom-transitions {
|
|
1093
|
-
@if map.has-key($map, $transitions-key) {
|
|
1094
|
-
@include spread-map-into-transitions(
|
|
1095
|
-
$map: $map,
|
|
1096
|
-
$prefix: $block,
|
|
1097
|
-
$key: $transitions-key,
|
|
1098
|
-
$block: $selector,
|
|
1099
|
-
$props: $props,
|
|
1100
|
-
$zero-specificity: $zero-specificity,
|
|
1101
|
-
$bps: $bps
|
|
1102
|
-
);
|
|
1103
|
-
}
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1106
|
-
// breakpoints
|
|
1107
|
-
@if not $custom-breakpoints {
|
|
1108
|
-
@if map.has-key($map, $breakpoints-key) {
|
|
1109
|
-
@include spread-map-into-breakpoints(
|
|
1110
|
-
$map: $map,
|
|
1111
|
-
$prefix: $block,
|
|
1112
|
-
$key: $breakpoints-key,
|
|
1113
|
-
$block: $selector,
|
|
1114
|
-
$props: $props,
|
|
1115
|
-
$zero-specificity: $zero-specificity,
|
|
1116
|
-
$bps: $bps
|
|
1117
|
-
);
|
|
1118
|
-
}
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
|
-
|
|
1123
|
-
// Transform a map into a list of transitions
|
|
1124
|
-
@mixin spread-map-into-transitions(
|
|
1125
|
-
$map: (),
|
|
1126
|
-
$prefix: '',
|
|
1127
|
-
$key: 'transition',
|
|
1128
|
-
$block: null,
|
|
1129
|
-
$props: true,
|
|
1130
|
-
$zero-specificity: true,
|
|
1131
|
-
$bps: (
|
|
1132
|
-
xxs: 0,
|
|
1133
|
-
)
|
|
1134
|
-
) {
|
|
1135
|
-
@if not $block {
|
|
1136
|
-
$block: &;
|
|
1137
|
-
}
|
|
1138
|
-
|
|
1139
|
-
@if meta.type-of(map.get($map, $key)) == 'map' {
|
|
1140
|
-
@each $transition, $states in map.get($map, $key) {
|
|
1141
|
-
@each $state, $value in $states {
|
|
1142
|
-
@if $state in [ 'enter-from', 'enter-active', 'enter-to',
|
|
1143
|
-
'leave-from', 'leave-active', 'leave-to', 'active',
|
|
1144
|
-
'inert'] and meta.type-of($value) == 'map'
|
|
1145
|
-
{
|
|
1146
|
-
$selector: '.#{$transition}';
|
|
1147
|
-
|
|
1148
|
-
@if $prefix != '' {
|
|
1149
|
-
$selector: '.#{$prefix}--#{$transition}';
|
|
1150
|
-
}
|
|
1151
|
-
|
|
1152
|
-
@if $state == 'active' {
|
|
1153
|
-
$selector: (
|
|
1154
|
-
'#{$selector}-enter-active',
|
|
1155
|
-
'#{$selector}-leave-active'
|
|
1156
|
-
);
|
|
1157
|
-
} @else if $state == 'inert' {
|
|
1158
|
-
$selector: (
|
|
1159
|
-
'#{$selector}-enter-from',
|
|
1160
|
-
'#{$selector}-leave-to'
|
|
1161
|
-
);
|
|
1162
|
-
} @else {
|
|
1163
|
-
$selector: '#{$selector}-#{$state}';
|
|
1164
|
-
}
|
|
1165
|
-
|
|
1166
|
-
// map props and attributes
|
|
1167
|
-
@include wrap-with-where(
|
|
1168
|
-
$selector,
|
|
1169
|
-
$enabled: $zero-specificity
|
|
1170
|
-
) {
|
|
1171
|
-
@include spread-map-into-attrs(
|
|
1172
|
-
$map: $value,
|
|
1173
|
-
$prefix: $prefix,
|
|
1174
|
-
$variant: #{$key}-#{$transition}-#{$state},
|
|
1175
|
-
$deep: true,
|
|
1176
|
-
$ignore: (
|
|
1177
|
-
'element',
|
|
1178
|
-
),
|
|
1179
|
-
$props: $props,
|
|
1180
|
-
$bps: $bps
|
|
1181
|
-
);
|
|
1182
|
-
}
|
|
1183
|
-
|
|
1184
|
-
// map elements
|
|
1185
|
-
@if map.get($value, 'element') {
|
|
1186
|
-
@include spread-map-into-elements(
|
|
1187
|
-
$original: $map,
|
|
1188
|
-
$map: $value,
|
|
1189
|
-
$prefix: #{$prefix}-#{$key}-#{$transition}-#{$state},
|
|
1190
|
-
$key: 'element',
|
|
1191
|
-
$block: $block,
|
|
1192
|
-
$modifier: $selector,
|
|
1193
|
-
$props: $props,
|
|
1194
|
-
$zero-specificity: $zero-specificity,
|
|
1195
|
-
$bps: $bps
|
|
1196
|
-
);
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1199
|
-
// map breakpoints
|
|
1200
|
-
@if map.get($value, 'breakpoint') {
|
|
1201
|
-
@include spread-map-into-breakpoints(
|
|
1202
|
-
$original: $map,
|
|
1203
|
-
$map: $value,
|
|
1204
|
-
$prefix: #{$prefix}-#{$key}-#{$transition}-#{$state},
|
|
1205
|
-
$key: 'breakpoint',
|
|
1206
|
-
$block: $block,
|
|
1207
|
-
$modifier: $selector,
|
|
1208
|
-
$props: $props,
|
|
1209
|
-
$zero-specificity: $zero-specificity,
|
|
1210
|
-
$bps: $bps
|
|
1211
|
-
);
|
|
1212
|
-
}
|
|
1213
|
-
}
|
|
1214
|
-
}
|
|
1215
|
-
}
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
6
|
+
@forward 'mixin-modules';
|