@volverjs/style 0.0.0
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/LICENSE +21 -0
- package/README.md +139 -0
- package/package.json +158 -0
- package/src/_config.scss +32 -0
- package/src/_context.scss +11 -0
- package/src/assets/24consulting.svg +63 -0
- package/src/assets/volverjs.svg +15 -0
- package/src/components/index.scss +17 -0
- package/src/components/vv-badge.scss +12 -0
- package/src/components/vv-button-group.scss +115 -0
- package/src/components/vv-button.scss +57 -0
- package/src/components/vv-card.scss +12 -0
- package/src/components/vv-collapse.scss +12 -0
- package/src/components/vv-dialog.scss +12 -0
- package/src/components/vv-dropdown.scss +12 -0
- package/src/components/vv-input-checkbox-group.scss +12 -0
- package/src/components/vv-input-checkbox.scss +28 -0
- package/src/components/vv-input-radio-group.scss +12 -0
- package/src/components/vv-input-radio.scss +20 -0
- package/src/components/vv-input-text.scss +49 -0
- package/src/components/vv-progress.scss +12 -0
- package/src/components/vv-select.scss +49 -0
- package/src/components/vv-table.scss +12 -0
- package/src/components/vv-text.scss +12 -0
- package/src/components/vv-textarea.scss +49 -0
- package/src/export.scss +411 -0
- package/src/preflight.scss +281 -0
- package/src/props/animation.scss +80 -0
- package/src/props/background.scss +5 -0
- package/src/props/borders.scss +6 -0
- package/src/props/colors.scss +5 -0
- package/src/props/effects.scss +5 -0
- package/src/props/filters.scss +6 -0
- package/src/props/index.scss +12 -0
- package/src/props/input.scss +5 -0
- package/src/props/layout.scss +6 -0
- package/src/props/media.scss +49 -0
- package/src/props/sizing.scss +6 -0
- package/src/props/spacing.scss +27 -0
- package/src/props/typography.scss +38 -0
- package/src/reset.scss +88 -0
- package/src/settings/_animation.scss +9 -0
- package/src/settings/_background.scss +56 -0
- package/src/settings/_borders.scss +24 -0
- package/src/settings/_breakpoints.scss +13 -0
- package/src/settings/_colors.scss +39 -0
- package/src/settings/_effects.scss +39 -0
- package/src/settings/_filters.scss +26 -0
- package/src/settings/_flexbox.scss +66 -0
- package/src/settings/_grid.scss +104 -0
- package/src/settings/_index.scss +34 -0
- package/src/settings/_input.scss +51 -0
- package/src/settings/_layout.scss +109 -0
- package/src/settings/_sizing.scss +99 -0
- package/src/settings/_spacing.scss +77 -0
- package/src/settings/_typography.scss +179 -0
- package/src/settings/components/_vv-badge.scss +43 -0
- package/src/settings/components/_vv-button-group.scss +20 -0
- package/src/settings/components/_vv-button.scss +214 -0
- package/src/settings/components/_vv-card.scss +74 -0
- package/src/settings/components/_vv-collapse.scss +111 -0
- package/src/settings/components/_vv-dialog.scss +183 -0
- package/src/settings/components/_vv-dropdown.scss +37 -0
- package/src/settings/components/_vv-input-checkbox-group.scss +60 -0
- package/src/settings/components/_vv-input-checkbox.scss +92 -0
- package/src/settings/components/_vv-input-radio-group.scss +1 -0
- package/src/settings/components/_vv-input-radio.scss +60 -0
- package/src/settings/components/_vv-input-text.scss +327 -0
- package/src/settings/components/_vv-progress.scss +45 -0
- package/src/settings/components/_vv-select.scss +216 -0
- package/src/settings/components/_vv-table.scss +29 -0
- package/src/settings/components/_vv-text.scss +42 -0
- package/src/settings/components/_vv-textarea.scss +275 -0
- package/src/style.scss +14 -0
- package/src/themes/dark/_context.scss +8 -0
- package/src/themes/dark/components/_vv-button.scss +24 -0
- package/src/themes/dark/components/_vv-input-checkbox.scss +24 -0
- package/src/themes/dark/components/index.scss +2 -0
- package/src/themes/dark/props/_background.scss +15 -0
- package/src/themes/dark/props/_colors.scss +15 -0
- package/src/themes/dark/props/index.scss +2 -0
- package/src/themes/dark/settings/_background.scss +12 -0
- package/src/themes/dark/settings/_colors.scss +15 -0
- package/src/themes/dark/settings/_index.scss +5 -0
- package/src/themes/dark/settings/components/_vv-button.scss +58 -0
- package/src/themes/dark/settings/components/_vv-input-checkbox.scss +26 -0
- package/src/themes/dark/style.scss +5 -0
- package/src/tools/_breakpoints.scss +126 -0
- package/src/tools/_functions.scss +138 -0
- package/src/tools/_index.scss +3 -0
- package/src/tools/_mixins.scss +902 -0
- package/src/utilities/animation.scss +8 -0
- package/src/utilities/backgrounds.scss +50 -0
- package/src/utilities/borders.scss +79 -0
- package/src/utilities/colors.scss +33 -0
- package/src/utilities/effects.scss +15 -0
- package/src/utilities/filters.scss +22 -0
- package/src/utilities/flexbox.scss +113 -0
- package/src/utilities/grid.scss +68 -0
- package/src/utilities/index.scss +12 -0
- package/src/utilities/layout.scss +188 -0
- package/src/utilities/sizing.scss +80 -0
- package/src/utilities/spacing.scss +109 -0
- package/src/utilities/typography.scss +226 -0
|
@@ -0,0 +1,902 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'sass:list';
|
|
3
|
+
@use 'sass:string';
|
|
4
|
+
@use 'sass:meta';
|
|
5
|
+
@use 'sass:selector';
|
|
6
|
+
|
|
7
|
+
// Check ascending order
|
|
8
|
+
// Used to ensure the breakpoints are ordered ascending.
|
|
9
|
+
@mixin assert-ascending($map, $map-name) {
|
|
10
|
+
$prev-key: null;
|
|
11
|
+
$prev-num: null;
|
|
12
|
+
@each $key, $num in $map {
|
|
13
|
+
@if not $prev-num or unit($num) == '%' {
|
|
14
|
+
// Do nothing
|
|
15
|
+
} @else if not comparable($prev-num, $num) {
|
|
16
|
+
@warn "Potentially invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} whose unit makes it incomparable to #{$prev-num}, the value of the previous key '#{$prev-key}' !";
|
|
17
|
+
} @else if $prev-num >= $num {
|
|
18
|
+
@warn "Invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} which isn't greater than #{$prev-num}, the value of the previous key '#{$prev-key}' !";
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
$prev-key: $key;
|
|
22
|
+
$prev-num: $num;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Starts at zero
|
|
27
|
+
// Used to ensure the min-width of the lowest breakpoint starts at 0.
|
|
28
|
+
@mixin assert-starts-at-zero($map, $map-name: '$grid-breakpoints') {
|
|
29
|
+
$values: map.values($map);
|
|
30
|
+
$first-value: list.nth($values, 1);
|
|
31
|
+
@if $first-value != 0 {
|
|
32
|
+
@warn "First breakpoint in #{$map-name} must start at 0, but starts at #{$first-value}.";
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Transform a map into a list of custom props
|
|
37
|
+
@mixin spread-map-into-props($map: (), $prefix: '', $old-key: '', $deep: true) {
|
|
38
|
+
@each $key, $value in $map {
|
|
39
|
+
$name: meta.inspect($key);
|
|
40
|
+
@if $name == meta.inspect($old-key) {
|
|
41
|
+
$name: $prefix;
|
|
42
|
+
} @else if $prefix != '' and meta.inspect($prefix) != meta.inspect($key)
|
|
43
|
+
{
|
|
44
|
+
$name: $prefix + '-' + $key;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// fix name
|
|
48
|
+
$name: str-replace($name, '\\/', '-');
|
|
49
|
+
|
|
50
|
+
@if string.slice(meta.inspect($key), 1, 1) !=
|
|
51
|
+
'_' and
|
|
52
|
+
string.slice(meta.inspect($key), 1, 2) !=
|
|
53
|
+
'--' and
|
|
54
|
+
string.slice(meta.inspect($key), 1, 1) !=
|
|
55
|
+
'['
|
|
56
|
+
{
|
|
57
|
+
@if type-of($value) == 'map' {
|
|
58
|
+
@if $deep {
|
|
59
|
+
@include spread-map-into-props($value, $name, $key);
|
|
60
|
+
}
|
|
61
|
+
} @else {
|
|
62
|
+
#{'--' + $name}: #{$value};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Transform a map into a list of utilities
|
|
69
|
+
@mixin spread-map-into-utilities(
|
|
70
|
+
$map: (),
|
|
71
|
+
$class: '',
|
|
72
|
+
$attribute: '',
|
|
73
|
+
$prop: '',
|
|
74
|
+
$name: '',
|
|
75
|
+
$deep: true,
|
|
76
|
+
$bps: (
|
|
77
|
+
xxs: 0,
|
|
78
|
+
),
|
|
79
|
+
$prefix: '',
|
|
80
|
+
$zero-specificity: $zero-specificity-for-utilities
|
|
81
|
+
) {
|
|
82
|
+
@if (type-of($map) == 'map' or type-of($map) == 'list') and $attribute != ''
|
|
83
|
+
{
|
|
84
|
+
@each $breakpoint, $breakpoint-value in $bps {
|
|
85
|
+
@if $breakpoint-value > 0 {
|
|
86
|
+
$prefix: $breakpoint + '\\:';
|
|
87
|
+
}
|
|
88
|
+
@each $key, $value in $map {
|
|
89
|
+
@if $name != '' and meta.inspect($key) != meta.inspect($name) {
|
|
90
|
+
$key: #{$name}-#{meta.inspect($key)};
|
|
91
|
+
}
|
|
92
|
+
@if type-of($value) == 'map' and $deep {
|
|
93
|
+
@include spread-map-into-utilities(
|
|
94
|
+
$value,
|
|
95
|
+
$class,
|
|
96
|
+
$attribute,
|
|
97
|
+
$prop,
|
|
98
|
+
$key,
|
|
99
|
+
$prefix
|
|
100
|
+
);
|
|
101
|
+
} @else {
|
|
102
|
+
$default: null;
|
|
103
|
+
$class-name: $class;
|
|
104
|
+
$key: meta.inspect($key);
|
|
105
|
+
$var: $prop;
|
|
106
|
+
|
|
107
|
+
// fix class name
|
|
108
|
+
@if $class-name != $key and $prop != $key {
|
|
109
|
+
@if $class-name != '' {
|
|
110
|
+
$class-name: $class-name + '-';
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
$class-name: $class-name + $key;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// fix variable name
|
|
117
|
+
@if $var != '' and $var != $key {
|
|
118
|
+
$var: $var + '-' + $key;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
$var: str-replace($var, '\\/', '-');
|
|
122
|
+
|
|
123
|
+
// check if value is not a map (spacing-dynamic)
|
|
124
|
+
@if type-of($value) != 'map' {
|
|
125
|
+
$default: $value;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// check if map is a list
|
|
129
|
+
@if type-of($map) ==
|
|
130
|
+
'list' and
|
|
131
|
+
(not $default or $default == '')
|
|
132
|
+
{
|
|
133
|
+
$default: $key;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
%#{$prefix}#{$class-name} {
|
|
137
|
+
@include media-breakpoint-up($breakpoint) {
|
|
138
|
+
@if type-of($attribute) != 'list' {
|
|
139
|
+
$attribute: ($attribute);
|
|
140
|
+
}
|
|
141
|
+
@each $attr in $attribute {
|
|
142
|
+
@if $default {
|
|
143
|
+
@if $var != '' {
|
|
144
|
+
#{$attr}: var(--#{$var}, $default);
|
|
145
|
+
} @else {
|
|
146
|
+
#{$attr}: $default;
|
|
147
|
+
}
|
|
148
|
+
} @else if $var != '' {
|
|
149
|
+
#{$attr}: var(--#{$var});
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
@include wrap-with-where(
|
|
155
|
+
$selector: '.' + $prefix + $class-name,
|
|
156
|
+
$enabled: $zero-specificity
|
|
157
|
+
) {
|
|
158
|
+
@extend %#{$prefix}#{$class-name};
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// Transform a map into a list of modifiers
|
|
167
|
+
@mixin spread-map-into-modifiers(
|
|
168
|
+
$map: (),
|
|
169
|
+
$prefix: '',
|
|
170
|
+
$key: 'modifier',
|
|
171
|
+
$block: null,
|
|
172
|
+
$props: true,
|
|
173
|
+
$zero-specificity: true
|
|
174
|
+
) {
|
|
175
|
+
@if not $block {
|
|
176
|
+
$block: &;
|
|
177
|
+
}
|
|
178
|
+
@if type-of(map.get($map, $key)) == 'map' {
|
|
179
|
+
@each $modifier, $value in map.get($map, $key) {
|
|
180
|
+
$selector: $block + '--' + $modifier;
|
|
181
|
+
|
|
182
|
+
%#{$prefix + '--' + $modifier} {
|
|
183
|
+
@include spread-map-into-attrs(
|
|
184
|
+
$original: $map,
|
|
185
|
+
$map: $value,
|
|
186
|
+
$prefix: $prefix,
|
|
187
|
+
$variant: #{$key}-#{$modifier},
|
|
188
|
+
$deep: true,
|
|
189
|
+
$ignore: (
|
|
190
|
+
'state',
|
|
191
|
+
'breakpoint',
|
|
192
|
+
'element',
|
|
193
|
+
),
|
|
194
|
+
$props: $props
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// map props and attributes
|
|
199
|
+
@include wrap-with-where(
|
|
200
|
+
$selector: $selector + $block,
|
|
201
|
+
$enabled: $zero-specificity
|
|
202
|
+
) {
|
|
203
|
+
@extend %#{$prefix + '--' + $modifier};
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// map elements
|
|
207
|
+
@if map.get($value, 'element') {
|
|
208
|
+
@include spread-map-into-elements(
|
|
209
|
+
$original: $map,
|
|
210
|
+
$map: $value,
|
|
211
|
+
$prefix: #{$prefix}-#{$key}-#{$modifier},
|
|
212
|
+
$key: 'element',
|
|
213
|
+
$block: $block,
|
|
214
|
+
$modifier: $selector,
|
|
215
|
+
$props: $props,
|
|
216
|
+
$zero-specificity: $zero-specificity
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// map states
|
|
221
|
+
@if map.get($value, 'state') {
|
|
222
|
+
@include spread-map-into-states(
|
|
223
|
+
$original: $map,
|
|
224
|
+
$map: $value,
|
|
225
|
+
$prefix: #{$prefix}-#{$key}-#{$modifier},
|
|
226
|
+
$key: 'state',
|
|
227
|
+
$block: $block,
|
|
228
|
+
$modifier: $selector,
|
|
229
|
+
$props: $props,
|
|
230
|
+
$zero-specificity: $zero-specificity
|
|
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}-#{$modifier},
|
|
239
|
+
$key: 'breakpoint',
|
|
240
|
+
$block: $selector,
|
|
241
|
+
$props: $props,
|
|
242
|
+
$zero-specificity: $zero-specificity
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// Transform a map into a list of BEM elements
|
|
250
|
+
@mixin spread-map-into-elements(
|
|
251
|
+
$original: (),
|
|
252
|
+
$map: (),
|
|
253
|
+
$prefix: '',
|
|
254
|
+
$key: 'element',
|
|
255
|
+
$block: null,
|
|
256
|
+
$modifier: null,
|
|
257
|
+
$props: true,
|
|
258
|
+
$zero-specificity: true
|
|
259
|
+
) {
|
|
260
|
+
@if not $block {
|
|
261
|
+
$block: &;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
@if type-of(map.get($map, $key)) == 'map' {
|
|
265
|
+
@each $element, $value in map.get($map, $key) {
|
|
266
|
+
$selector: $block + '__' + $element;
|
|
267
|
+
|
|
268
|
+
@if $modifier {
|
|
269
|
+
$selectors: ();
|
|
270
|
+
@each $item in selector.parse($modifier) {
|
|
271
|
+
$selectors: list.join(
|
|
272
|
+
$selectors,
|
|
273
|
+
selector.nest($item, $selector)
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
$selector: list-to-string($selectors);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// alias
|
|
281
|
+
$alias: map.get($value, '_alias');
|
|
282
|
+
|
|
283
|
+
@if not $alias {
|
|
284
|
+
$alias: map.get($original, $key, $element, '_alias');
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
@if $alias {
|
|
288
|
+
@if $modifier {
|
|
289
|
+
$aliases: ();
|
|
290
|
+
@each $item in selector.parse($modifier) {
|
|
291
|
+
$aliases: list.join(
|
|
292
|
+
$aliases,
|
|
293
|
+
selector.nest($item, $alias)
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
$alias: list-to-string($aliases);
|
|
298
|
+
} @else {
|
|
299
|
+
$alias: $block + ' ' + $alias;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
%#{$prefix + '__' + $element} {
|
|
304
|
+
@include spread-map-into-attrs(
|
|
305
|
+
$map: $value,
|
|
306
|
+
$prefix: $prefix,
|
|
307
|
+
$variant: #{$key}-#{$element},
|
|
308
|
+
$deep: true,
|
|
309
|
+
$ignore: (
|
|
310
|
+
'state',
|
|
311
|
+
'breakpoint',
|
|
312
|
+
),
|
|
313
|
+
$props: $props
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// attributes
|
|
318
|
+
@include wrap-with-where(
|
|
319
|
+
$selector: list-to-string(($selector, $alias)),
|
|
320
|
+
$enabled: $zero-specificity
|
|
321
|
+
) {
|
|
322
|
+
@extend %#{$prefix + '__' + $element};
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// states
|
|
326
|
+
@if map.get($value, 'state') {
|
|
327
|
+
@include spread-map-into-states(
|
|
328
|
+
$map: $value,
|
|
329
|
+
$prefix: #{$prefix}-#{$key}-#{$element},
|
|
330
|
+
$key: 'state',
|
|
331
|
+
$block: $selector,
|
|
332
|
+
$alias: $alias,
|
|
333
|
+
$props: $props,
|
|
334
|
+
$zero-specificity: $zero-specificity
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// breakpoints
|
|
339
|
+
@if map.get($value, 'breakpoint') {
|
|
340
|
+
@include spread-map-into-breakpoints(
|
|
341
|
+
$map: $value,
|
|
342
|
+
$prefix: #{$prefix}-#{$key}-#{$element},
|
|
343
|
+
$key: 'breakpoint',
|
|
344
|
+
$block: list-to-string(($selector, $alias)),
|
|
345
|
+
$props: $props,
|
|
346
|
+
$zero-specificity: $zero-specificity
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// Transform a map into a list of states
|
|
354
|
+
@mixin spread-map-into-states(
|
|
355
|
+
$original: null,
|
|
356
|
+
$map: (),
|
|
357
|
+
$prefix: '',
|
|
358
|
+
$key: 'state',
|
|
359
|
+
$block: null,
|
|
360
|
+
$modifier: '',
|
|
361
|
+
$alias: null,
|
|
362
|
+
$props: true,
|
|
363
|
+
$zero-specificity: true
|
|
364
|
+
) {
|
|
365
|
+
@if not $original {
|
|
366
|
+
$original: $map;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
@if not $block {
|
|
370
|
+
$blocks: &;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
@if type-of(map.get($map, $key)) == 'map' {
|
|
374
|
+
@each $state, $value in map.get($map, $key) {
|
|
375
|
+
@if list.index(
|
|
376
|
+
(
|
|
377
|
+
active,
|
|
378
|
+
focus,
|
|
379
|
+
hover,
|
|
380
|
+
focus-within,
|
|
381
|
+
target,
|
|
382
|
+
visited,
|
|
383
|
+
focus-visible,
|
|
384
|
+
disabled,
|
|
385
|
+
checked,
|
|
386
|
+
checked-within,
|
|
387
|
+
readonly,
|
|
388
|
+
empty,
|
|
389
|
+
placeholder-shown,
|
|
390
|
+
dirty,
|
|
391
|
+
valid,
|
|
392
|
+
invalid,
|
|
393
|
+
indeterminate,
|
|
394
|
+
first-child,
|
|
395
|
+
last-child,
|
|
396
|
+
open,
|
|
397
|
+
close,
|
|
398
|
+
determinate,
|
|
399
|
+
indeterminate
|
|
400
|
+
),
|
|
401
|
+
$state
|
|
402
|
+
)
|
|
403
|
+
{
|
|
404
|
+
$selectors: ();
|
|
405
|
+
|
|
406
|
+
@each $block-item in selector.parse($block) {
|
|
407
|
+
$selectors: list.join(
|
|
408
|
+
$selectors,
|
|
409
|
+
(
|
|
410
|
+
'#{$modifier}#{$block-item}--#{$state}',
|
|
411
|
+
'#{$modifier}#{$block-item}.#{$state}'
|
|
412
|
+
)
|
|
413
|
+
);
|
|
414
|
+
|
|
415
|
+
@if $alias {
|
|
416
|
+
$selectors: list.join(
|
|
417
|
+
$selectors,
|
|
418
|
+
'#{$modifier}#{$alias}.#{$state}'
|
|
419
|
+
);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
@if $state == 'checked-within' {
|
|
423
|
+
$selectors: list.join(
|
|
424
|
+
$selectors,
|
|
425
|
+
'#{$modifier}#{$block-item}:has(input:checked)'
|
|
426
|
+
);
|
|
427
|
+
|
|
428
|
+
@if $alias {
|
|
429
|
+
$selectors: list.join(
|
|
430
|
+
$selectors,
|
|
431
|
+
'#{$modifier}#{$alias}:has(input:checked)'
|
|
432
|
+
);
|
|
433
|
+
}
|
|
434
|
+
} @else if $state == 'open' {
|
|
435
|
+
$selectors: list.join(
|
|
436
|
+
$selectors,
|
|
437
|
+
'#{$modifier}#{$block-item}[open]'
|
|
438
|
+
);
|
|
439
|
+
|
|
440
|
+
@if $alias {
|
|
441
|
+
$selectors: list.join(
|
|
442
|
+
$selectors,
|
|
443
|
+
'#{$modifier}#{$alias}[open]'
|
|
444
|
+
);
|
|
445
|
+
}
|
|
446
|
+
} @else if $state == 'close' {
|
|
447
|
+
$selectors: list.join(
|
|
448
|
+
$selectors,
|
|
449
|
+
'#{$modifier}#{$block-item}:not([open])'
|
|
450
|
+
);
|
|
451
|
+
|
|
452
|
+
@if $alias {
|
|
453
|
+
$selectors: list.join(
|
|
454
|
+
$selectors,
|
|
455
|
+
'#{$modifier}#{$alias}:not([open])'
|
|
456
|
+
);
|
|
457
|
+
}
|
|
458
|
+
} @else if $state == 'dirty' {
|
|
459
|
+
$selectors: list.join(
|
|
460
|
+
$selectors,
|
|
461
|
+
'#{$modifier}#{$block-item}:not(:has(*:placeholder-shown))'
|
|
462
|
+
);
|
|
463
|
+
|
|
464
|
+
@if $alias {
|
|
465
|
+
$selectors: list.join(
|
|
466
|
+
$selectors,
|
|
467
|
+
'#{$modifier}#{$alias}:not(:has(*:placeholder-shown))'
|
|
468
|
+
);
|
|
469
|
+
}
|
|
470
|
+
} @else if $state == 'disabled' or $state == 'readonly' {
|
|
471
|
+
$selectors: list.join(
|
|
472
|
+
$selectors,
|
|
473
|
+
'#{$modifier}#{$block-item}[#{$state}]'
|
|
474
|
+
);
|
|
475
|
+
|
|
476
|
+
@if $alias {
|
|
477
|
+
$selectors: list.join(
|
|
478
|
+
$selectors,
|
|
479
|
+
'#{$modifier}#{$alias}[#{$state}]'
|
|
480
|
+
);
|
|
481
|
+
}
|
|
482
|
+
} @else if $state == 'focus-visible' {
|
|
483
|
+
$selectors: list.join(
|
|
484
|
+
$selectors,
|
|
485
|
+
'#{$modifier}#{$block-item}:not(:active):not([disabled]):not([tabindex="-1"]):#{$state}'
|
|
486
|
+
);
|
|
487
|
+
|
|
488
|
+
@if $alias {
|
|
489
|
+
$selectors: list.join(
|
|
490
|
+
$selectors,
|
|
491
|
+
'#{$modifier}#{$alias}:not(:active):not([disabled]):not([tabindex="-1"]):#{$state}'
|
|
492
|
+
);
|
|
493
|
+
}
|
|
494
|
+
} @else if $state == 'checked' {
|
|
495
|
+
$selectors: list.join(
|
|
496
|
+
$selectors,
|
|
497
|
+
'#{$modifier}#{$block-item}:#{$state}'
|
|
498
|
+
);
|
|
499
|
+
|
|
500
|
+
@if $alias {
|
|
501
|
+
$selectors: list.join(
|
|
502
|
+
$selectors,
|
|
503
|
+
'#{$modifier}#{$alias}:#{$state}'
|
|
504
|
+
);
|
|
505
|
+
}
|
|
506
|
+
} @else {
|
|
507
|
+
$selectors: list.join(
|
|
508
|
+
$selectors,
|
|
509
|
+
'#{$modifier}#{$block-item}:not([disabled]):#{$state}'
|
|
510
|
+
);
|
|
511
|
+
|
|
512
|
+
@if $alias {
|
|
513
|
+
$selectors: list.join(
|
|
514
|
+
$selectors,
|
|
515
|
+
'#{$modifier}#{$alias}:not([disabled]):#{$state}'
|
|
516
|
+
);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
$selector: list-to-string($selectors);
|
|
522
|
+
|
|
523
|
+
%#{$prefix + '--' + $state} {
|
|
524
|
+
@include spread-map-into-attrs(
|
|
525
|
+
$original: $original,
|
|
526
|
+
$map: $value,
|
|
527
|
+
$prefix: $prefix,
|
|
528
|
+
$variant: #{$key}-#{$state},
|
|
529
|
+
$ignore: (
|
|
530
|
+
'element',
|
|
531
|
+
),
|
|
532
|
+
$deep: true,
|
|
533
|
+
$props: $props
|
|
534
|
+
);
|
|
535
|
+
}
|
|
536
|
+
@include wrap-with-where(
|
|
537
|
+
$selector: $selector,
|
|
538
|
+
$enabled: $zero-specificity
|
|
539
|
+
) {
|
|
540
|
+
@extend %#{$prefix + '--' + $state};
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
// map elements
|
|
544
|
+
@if map.get($value, 'element') {
|
|
545
|
+
@include spread-map-into-elements(
|
|
546
|
+
$original: $original,
|
|
547
|
+
$map: $value,
|
|
548
|
+
$prefix: #{$prefix}-#{$key}-#{$state},
|
|
549
|
+
$key: 'element',
|
|
550
|
+
$block: $block,
|
|
551
|
+
$modifier: $selector,
|
|
552
|
+
$props: $props,
|
|
553
|
+
$zero-specificity: $zero-specificity
|
|
554
|
+
);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
// Transform a map into a list of breakpoints
|
|
562
|
+
@mixin spread-map-into-breakpoints(
|
|
563
|
+
$map: (),
|
|
564
|
+
$prefix: '',
|
|
565
|
+
$key: 'breakpoint',
|
|
566
|
+
$block: null,
|
|
567
|
+
$props: true,
|
|
568
|
+
$bps: $breakpoints,
|
|
569
|
+
$zero-specificity: true
|
|
570
|
+
) {
|
|
571
|
+
@if not $block {
|
|
572
|
+
$block: &;
|
|
573
|
+
}
|
|
574
|
+
@if type-of(map.get($map, $key)) == 'map' {
|
|
575
|
+
@each $breakpoint, $value in map.get($map, $key) {
|
|
576
|
+
@if map.has-key($bps, $breakpoint) {
|
|
577
|
+
@include wrap-with-where(
|
|
578
|
+
$selector: $block,
|
|
579
|
+
$enabled: $zero-specificity
|
|
580
|
+
) {
|
|
581
|
+
@include media-breakpoint-up($breakpoint, $bps) {
|
|
582
|
+
@include spread-map-into-attrs(
|
|
583
|
+
$original: $map,
|
|
584
|
+
$map: $value,
|
|
585
|
+
$prefix: $prefix,
|
|
586
|
+
$variant: #{$key}-#{$breakpoint},
|
|
587
|
+
$deep: true,
|
|
588
|
+
$props: $props
|
|
589
|
+
);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
@mixin pseudo-element-placehoder($pseudo-element) {
|
|
598
|
+
@if list.index(
|
|
599
|
+
(
|
|
600
|
+
calendar-picker-indicator,
|
|
601
|
+
search-cancel-button,
|
|
602
|
+
color-swatch-wrapper,
|
|
603
|
+
color-swatch,
|
|
604
|
+
inner-spin-button,
|
|
605
|
+
outer-spin-button,
|
|
606
|
+
progress-bar,
|
|
607
|
+
progress-value,
|
|
608
|
+
progress-inner-element
|
|
609
|
+
),
|
|
610
|
+
$pseudo-element
|
|
611
|
+
)
|
|
612
|
+
{
|
|
613
|
+
&::-webkit-#{$pseudo-element} {
|
|
614
|
+
@content;
|
|
615
|
+
}
|
|
616
|
+
&::-moz-#{$pseudo-element} {
|
|
617
|
+
@content;
|
|
618
|
+
}
|
|
619
|
+
} @else {
|
|
620
|
+
&::#{$pseudo-element} {
|
|
621
|
+
@content;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
// Transform a map into a list of CSS attributes
|
|
627
|
+
@mixin spread-map-into-attrs(
|
|
628
|
+
$original: (),
|
|
629
|
+
$map: (),
|
|
630
|
+
$prefix: '',
|
|
631
|
+
$variant: '',
|
|
632
|
+
$postfix: '',
|
|
633
|
+
$deep: false,
|
|
634
|
+
$ignore: (),
|
|
635
|
+
$props: true
|
|
636
|
+
) {
|
|
637
|
+
@if type-of($map) == 'map' and $prefix != '' {
|
|
638
|
+
@each $key, $value in $map {
|
|
639
|
+
@if not list.index($ignore, $key) {
|
|
640
|
+
@if type-of($value) == 'map' and ($deep or $key == 'pseudo') {
|
|
641
|
+
$original: map.get($original, $key);
|
|
642
|
+
|
|
643
|
+
@if not $original {
|
|
644
|
+
$original: ();
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
@if $postfix != '' {
|
|
648
|
+
$key: #{$postfix}-#{$key};
|
|
649
|
+
}
|
|
650
|
+
@if $key == 'pseudo' {
|
|
651
|
+
@each $pseudo-element, $pseudo-map in $value {
|
|
652
|
+
@if type-of($pseudo-map) == 'map' {
|
|
653
|
+
@if list.index(
|
|
654
|
+
(
|
|
655
|
+
before,
|
|
656
|
+
after,
|
|
657
|
+
placeholder,
|
|
658
|
+
calendar-picker-indicator,
|
|
659
|
+
search-cancel-button,
|
|
660
|
+
color-swatch-wrapper,
|
|
661
|
+
color-swatch,
|
|
662
|
+
inner-spin-button,
|
|
663
|
+
outer-spin-button,
|
|
664
|
+
progress-bar,
|
|
665
|
+
progress-value,
|
|
666
|
+
inner-element,
|
|
667
|
+
-webkit-progress-bar,
|
|
668
|
+
-webkit-progress-value,
|
|
669
|
+
-webkit-inner-element,
|
|
670
|
+
-moz-progress-bar,
|
|
671
|
+
-moz-progress-value,
|
|
672
|
+
-moz-inner-element
|
|
673
|
+
),
|
|
674
|
+
$pseudo-element
|
|
675
|
+
)
|
|
676
|
+
{
|
|
677
|
+
$original: map.get(
|
|
678
|
+
$original,
|
|
679
|
+
$pseudo-element
|
|
680
|
+
);
|
|
681
|
+
$key: pseudo-#{$pseudo-element};
|
|
682
|
+
|
|
683
|
+
@include pseudo-element-placehoder(
|
|
684
|
+
$pseudo-element
|
|
685
|
+
) {
|
|
686
|
+
@if not $original {
|
|
687
|
+
@if not
|
|
688
|
+
map.has-key(
|
|
689
|
+
$pseudo-map,
|
|
690
|
+
'content'
|
|
691
|
+
)
|
|
692
|
+
{
|
|
693
|
+
content: '';
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
$original: ();
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
@include spread-map-into-attrs(
|
|
700
|
+
$original: $original,
|
|
701
|
+
$map: $pseudo-map,
|
|
702
|
+
$prefix: $prefix,
|
|
703
|
+
$variant: $variant,
|
|
704
|
+
$postfix: $key,
|
|
705
|
+
$deep: true,
|
|
706
|
+
$props: $props
|
|
707
|
+
);
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
} @else {
|
|
713
|
+
@include spread-map-into-attrs(
|
|
714
|
+
$original: $original,
|
|
715
|
+
$map: $value,
|
|
716
|
+
$prefix: $prefix,
|
|
717
|
+
$variant: $variant,
|
|
718
|
+
$postfix: $key,
|
|
719
|
+
$deep: true,
|
|
720
|
+
$props: $props
|
|
721
|
+
);
|
|
722
|
+
}
|
|
723
|
+
} @else if
|
|
724
|
+
type-of($value) !=
|
|
725
|
+
'map' and
|
|
726
|
+
(string.slice(meta.inspect($key), 1, 1) != '_')
|
|
727
|
+
{
|
|
728
|
+
@if $props and
|
|
729
|
+
$key !=
|
|
730
|
+
'content' and
|
|
731
|
+
(string.slice(meta.inspect($key), 1, 2) != '--') and
|
|
732
|
+
(string.slice(meta.inspect($key), 1, 1) != '[')
|
|
733
|
+
{
|
|
734
|
+
$prop-to-replace: --#{$prefix};
|
|
735
|
+
$prop-to-replace-with: --#{$prefix};
|
|
736
|
+
|
|
737
|
+
// add variant
|
|
738
|
+
@if $variant != '' {
|
|
739
|
+
$prop-to-replace-with: #{$prop-to-replace-with}-#{$variant};
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
// add postfix
|
|
743
|
+
@if $postfix != '' {
|
|
744
|
+
$prop-to-replace: #{$prop-to-replace}-#{$postfix};
|
|
745
|
+
$prop-to-replace-with: #{$prop-to-replace-with}-#{$postfix};
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
// add key
|
|
749
|
+
$prop-to-replace: #{$prop-to-replace}-#{$key};
|
|
750
|
+
$prop-to-replace-with: #{$prop-to-replace-with}-#{$key};
|
|
751
|
+
|
|
752
|
+
@if map.get($original, $key) {
|
|
753
|
+
#{$prop-to-replace}: var(#{$prop-to-replace-with});
|
|
754
|
+
} @else {
|
|
755
|
+
#{$key}: var(#{$prop-to-replace-with});
|
|
756
|
+
}
|
|
757
|
+
} @else {
|
|
758
|
+
@if string.slice(meta.inspect($key), 1, 1) == '[' {
|
|
759
|
+
$key: string.slice(
|
|
760
|
+
meta.inspect($key),
|
|
761
|
+
2,
|
|
762
|
+
string.length(meta.inspect($key)) - 1
|
|
763
|
+
);
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
#{$key}: #{$value};
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
// Wrap selector with :where()
|
|
775
|
+
@mixin wrap-with-where($selector, $enabled: true) {
|
|
776
|
+
@if type-of($selector) == 'map' {
|
|
777
|
+
$merged: '';
|
|
778
|
+
@each $element in $selector {
|
|
779
|
+
@if $enabled {
|
|
780
|
+
$merged: '#{$merged}, :where(#{$element})';
|
|
781
|
+
} @else {
|
|
782
|
+
$merged: '#{$merged}, #{$element}';
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
} @else if $enabled {
|
|
786
|
+
$selector: ':where(#{$selector})';
|
|
787
|
+
}
|
|
788
|
+
#{$selector} {
|
|
789
|
+
@content;
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
// Transform a map into a BEM component
|
|
794
|
+
@mixin spread-map-into-bem(
|
|
795
|
+
$map,
|
|
796
|
+
$block: '',
|
|
797
|
+
$elements-key: 'element',
|
|
798
|
+
$modifiers-key: 'modifier',
|
|
799
|
+
$states-key: 'state',
|
|
800
|
+
$breakpoints-key: 'breakpoint',
|
|
801
|
+
$props: true,
|
|
802
|
+
$zero-specificity: true,
|
|
803
|
+
$custom-block: false,
|
|
804
|
+
$custom-elements: false,
|
|
805
|
+
$custom-modifiers: false,
|
|
806
|
+
$custom-states: false,
|
|
807
|
+
$custom-breakpoints: false
|
|
808
|
+
) {
|
|
809
|
+
@if type-of($map) == 'map' and $block != '' {
|
|
810
|
+
$selector: '.' + $block;
|
|
811
|
+
|
|
812
|
+
// custom props
|
|
813
|
+
@if $props {
|
|
814
|
+
:where(:host, :root, .theme) {
|
|
815
|
+
@include spread-map-into-props(
|
|
816
|
+
$map: $map,
|
|
817
|
+
$prefix: $block,
|
|
818
|
+
$deep: true
|
|
819
|
+
);
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
// block
|
|
824
|
+
@if not $custom-block {
|
|
825
|
+
%#{$block} {
|
|
826
|
+
@include spread-map-into-attrs(
|
|
827
|
+
$map: $map,
|
|
828
|
+
$prefix: $block,
|
|
829
|
+
$props: $props
|
|
830
|
+
);
|
|
831
|
+
|
|
832
|
+
// content
|
|
833
|
+
@content;
|
|
834
|
+
}
|
|
835
|
+
@include wrap-with-where(
|
|
836
|
+
$selector: $selector,
|
|
837
|
+
$enabled: $zero-specificity
|
|
838
|
+
) {
|
|
839
|
+
@extend %#{$block};
|
|
840
|
+
}
|
|
841
|
+
} @else {
|
|
842
|
+
// content
|
|
843
|
+
@content;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
// elements
|
|
847
|
+
@if not $custom-elements {
|
|
848
|
+
@if map.has-key($map, $elements-key) {
|
|
849
|
+
@include spread-map-into-elements(
|
|
850
|
+
$map: $map,
|
|
851
|
+
$prefix: $block,
|
|
852
|
+
$key: $elements-key,
|
|
853
|
+
$block: $selector,
|
|
854
|
+
$props: $props,
|
|
855
|
+
$zero-specificity: $zero-specificity
|
|
856
|
+
);
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
// states
|
|
861
|
+
@if not $custom-states {
|
|
862
|
+
@if map.has-key($map, $states-key) {
|
|
863
|
+
@include spread-map-into-states(
|
|
864
|
+
$map: $map,
|
|
865
|
+
$prefix: $block,
|
|
866
|
+
$key: $states-key,
|
|
867
|
+
$block: $selector,
|
|
868
|
+
$props: $props,
|
|
869
|
+
$zero-specificity: $zero-specificity
|
|
870
|
+
);
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
// modifiers
|
|
875
|
+
@if not $custom-modifiers {
|
|
876
|
+
@if map.has-key($map, $modifiers-key) {
|
|
877
|
+
@include spread-map-into-modifiers(
|
|
878
|
+
$map: $map,
|
|
879
|
+
$prefix: $block,
|
|
880
|
+
$key: $modifiers-key,
|
|
881
|
+
$block: $selector,
|
|
882
|
+
$props: $props,
|
|
883
|
+
$zero-specificity: $zero-specificity
|
|
884
|
+
);
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
// breakpoints
|
|
889
|
+
@if not $custom-breakpoints {
|
|
890
|
+
@if map.has-key($map, $breakpoints-key) {
|
|
891
|
+
@include spread-map-into-breakpoints(
|
|
892
|
+
$map: $map,
|
|
893
|
+
$prefix: $block,
|
|
894
|
+
$key: $breakpoints-key,
|
|
895
|
+
$block: $selector,
|
|
896
|
+
$props: $props,
|
|
897
|
+
$zero-specificity: $zero-specificity
|
|
898
|
+
);
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
}
|