@volverjs/style 0.1.28 → 0.1.30-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/design-tokens.json +503 -7
- package/dist/base.css +1 -1
- package/dist/components/vv-alert.css +1 -1
- package/dist/components/vv-attachment-group.css +1 -0
- package/dist/components/vv-attachment.css +1 -0
- package/dist/components/vv-avatar.css +1 -1
- package/dist/components/vv-badge.css +1 -1
- package/dist/components/vv-breadcrumb.css +1 -1
- package/dist/components/vv-bubble-group.css +1 -0
- package/dist/components/vv-bubble.css +1 -0
- package/dist/components/vv-button.css +1 -1
- package/dist/components/vv-calendar.css +1 -0
- package/dist/components/vv-checkbox-group.css +1 -1
- package/dist/components/vv-checkbox.css +1 -1
- package/dist/components/vv-command.css +1 -0
- package/dist/components/vv-dialog.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-empty.css +1 -0
- package/dist/components/vv-field.css +1 -0
- package/dist/components/vv-input-file.css +1 -1
- package/dist/components/vv-input-otp.css +1 -0
- package/dist/components/vv-input-range.css +1 -1
- package/dist/components/vv-input-text.css +1 -1
- package/dist/components/vv-item-group.css +1 -0
- package/dist/components/vv-item.css +1 -0
- package/dist/components/vv-kbd-group.css +1 -0
- package/dist/components/vv-kbd.css +1 -0
- package/dist/components/vv-marker.css +1 -0
- package/dist/components/vv-message-scroller.css +1 -0
- package/dist/components/vv-message.css +1 -0
- package/dist/components/vv-nav.css +1 -1
- package/dist/components/vv-pagination.css +1 -0
- package/dist/components/vv-popover.css +1 -0
- package/dist/components/vv-progress.css +1 -1
- package/dist/components/vv-prose.css +1 -0
- package/dist/components/vv-questionnaire.css +1 -0
- package/dist/components/vv-radio-group.css +1 -1
- package/dist/components/vv-radio.css +1 -1
- package/dist/components/vv-select.css +1 -1
- package/dist/components/vv-separator.css +1 -0
- package/dist/components/vv-sidebar.css +1 -0
- package/dist/components/vv-spinner.css +1 -0
- package/dist/components/vv-table.css +1 -1
- package/dist/components/vv-text.css +1 -1
- package/dist/components/vv-textarea.css +1 -1
- package/dist/components.css +1 -1
- package/dist/export.css +1 -1
- package/dist/props/colors.css +1 -1
- package/dist/props/input.css +1 -1
- package/dist/props.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/colors.css +1 -1
- package/dist/utilities/layout.css +1 -1
- package/dist/utilities.css +1 -1
- package/dist/volver.css +1 -1
- package/package.json +49 -1
- package/src/_config.scss +23 -0
- package/src/_preflight.scss +14 -2
- package/src/components/index.scss +28 -0
- package/src/components/vv-attachment-group.scss +17 -0
- package/src/components/vv-attachment.scss +17 -0
- package/src/components/vv-bubble-group.scss +17 -0
- package/src/components/vv-bubble.scss +17 -0
- package/src/components/vv-calendar.scss +25 -0
- package/src/components/vv-command.scss +17 -0
- package/src/components/vv-empty.scss +17 -0
- package/src/components/vv-field.scss +25 -0
- package/src/components/vv-input-otp.scss +17 -0
- package/src/components/vv-item-group.scss +17 -0
- package/src/components/vv-item.scss +39 -0
- package/src/components/vv-kbd-group.scss +17 -0
- package/src/components/vv-kbd.scss +17 -0
- package/src/components/vv-marker.scss +17 -0
- package/src/components/vv-message-scroller.scss +24 -0
- package/src/components/vv-message.scss +25 -0
- package/src/components/vv-pagination.scss +17 -0
- package/src/components/vv-popover.scss +17 -0
- package/src/components/vv-prose.scss +17 -0
- package/src/components/vv-questionnaire.scss +28 -0
- package/src/components/vv-separator.scss +17 -0
- package/src/components/vv-sidebar.scss +17 -0
- package/src/components/vv-spinner.scss +27 -0
- package/src/presets/_outlined-fields.scss +346 -0
- package/src/props/colors.scss +6 -0
- package/src/props/index.scss +4 -1
- package/src/props/media.scss +21 -6
- package/src/settings/_colors.scss +161 -61
- package/src/settings/_index.scss +26 -0
- package/src/settings/_input.scss +9 -0
- package/src/settings/components/_choice.scss +104 -0
- package/src/settings/components/_vv-alert.scss +37 -12
- package/src/settings/components/_vv-attachment-group.scss +10 -0
- package/src/settings/components/_vv-attachment.scss +135 -0
- package/src/settings/components/_vv-avatar.scss +17 -7
- package/src/settings/components/_vv-badge.scss +21 -13
- package/src/settings/components/_vv-breadcrumb.scss +1 -1
- package/src/settings/components/_vv-bubble-group.scss +31 -0
- package/src/settings/components/_vv-bubble.scss +69 -0
- package/src/settings/components/_vv-button.scss +48 -5
- package/src/settings/components/_vv-calendar.scss +102 -0
- package/src/settings/components/_vv-checkbox-group.scss +33 -2
- package/src/settings/components/_vv-checkbox.scss +7 -2
- package/src/settings/components/_vv-command.scss +99 -0
- package/src/settings/components/_vv-dialog.scss +129 -26
- package/src/settings/components/_vv-dropdown-action.scss +2 -1
- package/src/settings/components/_vv-dropdown-option.scss +3 -3
- package/src/settings/components/_vv-empty.scss +71 -0
- package/src/settings/components/_vv-field.scss +111 -0
- package/src/settings/components/_vv-input-file.scss +6 -6
- package/src/settings/components/_vv-input-otp.scss +55 -0
- package/src/settings/components/_vv-input-range.scss +2 -2
- package/src/settings/components/_vv-input-text.scss +6 -6
- package/src/settings/components/_vv-item-group.scss +68 -0
- package/src/settings/components/_vv-item.scss +201 -0
- package/src/settings/components/_vv-kbd-group.scss +9 -0
- package/src/settings/components/_vv-kbd.scss +20 -0
- package/src/settings/components/_vv-marker.scss +32 -0
- package/src/settings/components/_vv-message-scroller.scss +65 -0
- package/src/settings/components/_vv-message.scss +95 -0
- package/src/settings/components/_vv-nav.scss +7 -3
- package/src/settings/components/_vv-pagination.scss +78 -0
- package/src/settings/components/_vv-popover.scss +53 -0
- package/src/settings/components/_vv-progress.scss +4 -4
- package/src/settings/components/_vv-prose.scss +274 -0
- package/src/settings/components/_vv-questionnaire.scss +77 -0
- package/src/settings/components/_vv-radio.scss +6 -2
- package/src/settings/components/_vv-select.scss +5 -5
- package/src/settings/components/_vv-separator.scss +79 -0
- package/src/settings/components/_vv-sidebar.scss +91 -0
- package/src/settings/components/_vv-spinner.scss +26 -0
- package/src/settings/components/_vv-table.scss +63 -0
- package/src/settings/components/_vv-text.scss +2 -2
- package/src/settings/components/_vv-textarea.scss +6 -6
- package/src/themes/dark/components/_vv-checkbox.scss +27 -0
- package/src/themes/dark/components/_vv-radio.scss +27 -0
- package/src/themes/dark/components/index.scss +2 -0
- package/src/themes/dark/props/_colors.scss +6 -0
- package/src/themes/dark/settings/_colors.scss +97 -32
- package/src/themes/dark/settings/_index.scss +2 -0
- package/src/themes/dark/settings/components/_choice.scss +15 -0
- package/src/themes/dark/settings/components/_vv-alert.scss +6 -48
- package/src/themes/dark/settings/components/_vv-avatar.scss +1 -16
- package/src/themes/dark/settings/components/_vv-badge.scss +1 -32
- package/src/themes/dark/settings/components/_vv-button.scss +0 -8
- package/src/themes/dark/settings/components/_vv-checkbox.scss +7 -0
- package/src/themes/dark/settings/components/_vv-dropdown-action.scss +2 -3
- package/src/themes/dark/settings/components/_vv-dropdown-option.scss +2 -19
- package/src/themes/dark/settings/components/_vv-nav.scss +2 -15
- package/src/themes/dark/settings/components/_vv-radio.scss +7 -0
- package/src/tools/_functions.scss +430 -2
- package/src/tools/mixin-modules/_bem.scss +5 -39
- package/src/tools/mixin-modules/_states.scss +77 -0
- package/src/tools/mixin-modules/_theme.scss +135 -121
- package/src/utilities/colors.scss +49 -4
- package/src/utilities/layout.scss +25 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../context' as *;
|
|
3
|
+
|
|
4
|
+
@include layer(components, $use-css-layers, $layer-prefix) {
|
|
5
|
+
$component-name: map.get($components-names, vv-prose);
|
|
6
|
+
$component-map: $vv-prose;
|
|
7
|
+
$component-selector: '.#{ $component-name}';
|
|
8
|
+
|
|
9
|
+
@include spread-map-into-bem(
|
|
10
|
+
$map: $component-map,
|
|
11
|
+
$block: $component-name,
|
|
12
|
+
$use-custom-props: $use-custom-props-for-components,
|
|
13
|
+
$zero-specificity: $zero-specificity-for-components,
|
|
14
|
+
$bps: $breakpoints
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../context' as *;
|
|
3
|
+
|
|
4
|
+
@include layer(components, $use-css-layers, $layer-prefix) {
|
|
5
|
+
$component-name: map.get($components-names, vv-questionnaire);
|
|
6
|
+
$component-map: $vv-questionnaire;
|
|
7
|
+
$component-selector: '.#{ $component-name}';
|
|
8
|
+
|
|
9
|
+
@include spread-map-into-bem(
|
|
10
|
+
$map: $component-map,
|
|
11
|
+
$block: $component-name,
|
|
12
|
+
$use-custom-props: $use-custom-props-for-components,
|
|
13
|
+
$zero-specificity: $zero-specificity-for-components,
|
|
14
|
+
$bps: $breakpoints
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
// A title followed by its description sits close over it, and the space
|
|
18
|
+
// before the choices is the description's. The map cannot say "a title with a
|
|
19
|
+
// description after it", and the title is the `legend` of a choice, so it has
|
|
20
|
+
// to be told from the sibling it has, not from a wrapper.
|
|
21
|
+
@include wrap-with-where(
|
|
22
|
+
$selector: '#{$component-selector}__title:has(+ #{$component-selector}__description)',
|
|
23
|
+
$enabled: $zero-specificity-for-components
|
|
24
|
+
) {
|
|
25
|
+
margin-block-end: var(--spacing-4);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../context' as *;
|
|
3
|
+
|
|
4
|
+
@include layer(components, $use-css-layers, $layer-prefix) {
|
|
5
|
+
$component-name: map.get($components-names, vv-separator);
|
|
6
|
+
$component-map: $vv-separator;
|
|
7
|
+
$component-selector: '.#{ $component-name}';
|
|
8
|
+
|
|
9
|
+
@include spread-map-into-bem(
|
|
10
|
+
$map: $component-map,
|
|
11
|
+
$block: $component-name,
|
|
12
|
+
$use-custom-props: $use-custom-props-for-components,
|
|
13
|
+
$zero-specificity: $zero-specificity-for-components,
|
|
14
|
+
$bps: $breakpoints
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../context' as *;
|
|
3
|
+
|
|
4
|
+
@include layer(components, $use-css-layers, $layer-prefix) {
|
|
5
|
+
$component-name: map.get($components-names, vv-sidebar);
|
|
6
|
+
$component-map: $vv-sidebar;
|
|
7
|
+
$component-selector: '.#{ $component-name}';
|
|
8
|
+
|
|
9
|
+
@include spread-map-into-bem(
|
|
10
|
+
$map: $component-map,
|
|
11
|
+
$block: $component-name,
|
|
12
|
+
$use-custom-props: $use-custom-props-for-components,
|
|
13
|
+
$zero-specificity: $zero-specificity-for-components,
|
|
14
|
+
$bps: $breakpoints
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../context' as *;
|
|
3
|
+
|
|
4
|
+
@include layer(components, $use-css-layers, $layer-prefix) {
|
|
5
|
+
$component-name: map.get($components-names, vv-spinner);
|
|
6
|
+
$component-map: $vv-spinner;
|
|
7
|
+
$component-selector: '.#{ $component-name}';
|
|
8
|
+
|
|
9
|
+
@include spread-map-into-bem(
|
|
10
|
+
$map: $component-map,
|
|
11
|
+
$block: $component-name,
|
|
12
|
+
$use-custom-props: $use-custom-props-for-components,
|
|
13
|
+
$zero-specificity: $zero-specificity-for-components,
|
|
14
|
+
$bps: $breakpoints
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
// A spinner that stands still says nothing, so reduced motion slows the ring
|
|
18
|
+
// down rather than stopping it. The map cannot express a media feature, and
|
|
19
|
+
// this rule comes after the block's own, which it overrides at the same
|
|
20
|
+
// specificity.
|
|
21
|
+
@media (prefers-reduced-motion: reduce) {
|
|
22
|
+
@include wrap-with-where($selector: $component-selector, $enabled: $zero-specificity-for-components) {
|
|
23
|
+
--spinner-duration: 1.5s;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
}
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../context' as ctx;
|
|
3
|
+
|
|
4
|
+
// Outlined fields: every field of the library as a box on the plain surface,
|
|
5
|
+
// a 1px border, a radius, and a ring on focus, instead of the default filled
|
|
6
|
+
// box with a line underneath and a brand bar sliding in on focus. Opt in by
|
|
7
|
+
// loading this module after the context and before the library emits
|
|
8
|
+
// anything:
|
|
9
|
+
|
|
10
|
+
// @use '@volverjs/style/scss/context' with (...);
|
|
11
|
+
// @use '@volverjs/style/scss/presets/outlined-fields';
|
|
12
|
+
// @use '@volverjs/style/scss';
|
|
13
|
+
|
|
14
|
+
// It reassigns `$input` and the maps of `vv-input-text`, `vv-textarea`,
|
|
15
|
+
// `vv-select`, `vv-input-file` and `vv-field`, so it has to run before the
|
|
16
|
+
// props and the components are emitted: loaded later it changes nothing. It
|
|
17
|
+
// changes the look only, not the density: heights, paddings and font sizes
|
|
18
|
+
// stay those of the library. The new tokens are `--input-border-color`,
|
|
19
|
+
// `--input-border-color-hover`, `--input-border-radius`,
|
|
20
|
+
// `--input-focus-color`, `--input-focus-ring`, `--input-invalid-ring` and
|
|
21
|
+
// `--input-disabled-*`; the dark theme follows through the colours they read.
|
|
22
|
+
|
|
23
|
+
ctx.$input: map.deep-merge(
|
|
24
|
+
ctx.$input,
|
|
25
|
+
(
|
|
26
|
+
// The filled pattern darkened the surface on hover and focus; the
|
|
27
|
+
// outlined one keeps it still and moves the border instead
|
|
28
|
+
background-color: var(--color-surface),
|
|
29
|
+
background-color-hover: var(--color-surface),
|
|
30
|
+
background-color-focus: var(--color-surface),
|
|
31
|
+
border-color: var(--color-surface-4),
|
|
32
|
+
border-color-hover: var(--color-surface-5),
|
|
33
|
+
border-radius: var(--rounded-lg),
|
|
34
|
+
// The ring is the only focus indication and has to hold on its own
|
|
35
|
+
focus-color: var(--color-brand),
|
|
36
|
+
focus-ring: 0 0 0 var(--spacing-3)
|
|
37
|
+
color-mix(in srgb, var(--input-focus-color) 16%, transparent),
|
|
38
|
+
invalid-ring: 0 0 0 var(--spacing-3)
|
|
39
|
+
color-mix(in srgb, var(--input-invalid-color) 14%, transparent),
|
|
40
|
+
disabled-background-color: var(--color-surface-1),
|
|
41
|
+
disabled-border-color: var(--color-surface-3),
|
|
42
|
+
disabled-color: var(--color-word-3),
|
|
43
|
+
transition: (
|
|
44
|
+
border-color var(--duration-150) var(--ease-out),
|
|
45
|
+
box-shadow var(--duration-150) var(--ease-out),
|
|
46
|
+
),
|
|
47
|
+
// The text keeps the padding of the field (the filled pattern pushed
|
|
48
|
+
// it down to make room inside the box) and the label rises to sit on
|
|
49
|
+
// the top border, half above it and half below
|
|
50
|
+
floating: (
|
|
51
|
+
padding-top: var(--input-spacing-top),
|
|
52
|
+
padding-bottom: var(--input-spacing-bottom),
|
|
53
|
+
label: (
|
|
54
|
+
translate: 0 -50%,
|
|
55
|
+
),
|
|
56
|
+
),
|
|
57
|
+
)
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
// The box around the control: the two pseudo elements of the filled pattern
|
|
61
|
+
// are hidden and every state moves to the border and the ring
|
|
62
|
+
$-wrapper: (
|
|
63
|
+
border: var(--spacing-px) solid var(--input-border-color),
|
|
64
|
+
border-radius: var(--input-border-radius),
|
|
65
|
+
transition: var(--input-transition),
|
|
66
|
+
pseudo: (
|
|
67
|
+
before: (
|
|
68
|
+
display: none,
|
|
69
|
+
),
|
|
70
|
+
after: (
|
|
71
|
+
display: none,
|
|
72
|
+
),
|
|
73
|
+
),
|
|
74
|
+
state: (
|
|
75
|
+
hover: (
|
|
76
|
+
border-color: var(--input-border-color-hover),
|
|
77
|
+
),
|
|
78
|
+
focus-within: (
|
|
79
|
+
border-color: var(--input-focus-color),
|
|
80
|
+
box-shadow: var(--input-focus-ring),
|
|
81
|
+
),
|
|
82
|
+
),
|
|
83
|
+
);
|
|
84
|
+
$-wrapper-invalid: (
|
|
85
|
+
border-color: var(--input-invalid-color),
|
|
86
|
+
state: (
|
|
87
|
+
hover: (
|
|
88
|
+
border-color: var(--input-invalid-color),
|
|
89
|
+
),
|
|
90
|
+
focus-within: (
|
|
91
|
+
border-color: var(--input-invalid-color),
|
|
92
|
+
box-shadow: var(--input-invalid-ring),
|
|
93
|
+
),
|
|
94
|
+
),
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
// Success has no ring of its own: the border says it
|
|
98
|
+
$-wrapper-valid: (
|
|
99
|
+
border-color: var(--input-valid-color),
|
|
100
|
+
state: (
|
|
101
|
+
hover: (
|
|
102
|
+
border-color: var(--input-valid-color),
|
|
103
|
+
),
|
|
104
|
+
focus-within: (
|
|
105
|
+
border-color: var(--input-valid-color),
|
|
106
|
+
),
|
|
107
|
+
),
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
// The indeterminate bar of `loading` is the `::after` of the filled pattern,
|
|
111
|
+
// shown again and pulled in by the radius so it runs along the straight part
|
|
112
|
+
// of the bottom edge
|
|
113
|
+
$-wrapper-loading: (
|
|
114
|
+
pseudo: (
|
|
115
|
+
after: (
|
|
116
|
+
display: block,
|
|
117
|
+
inset: auto var(--input-border-radius) 0,
|
|
118
|
+
),
|
|
119
|
+
),
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
// A quiet box that does not react. The label stays readable at full
|
|
123
|
+
// opacity: the box says it is disabled by itself. The dimmed text goes on the
|
|
124
|
+
// control of each field (`$-disabled-control` below), not through a token on
|
|
125
|
+
// the box: the control reads its colour from a property resolved at the root.
|
|
126
|
+
$-disabled: (
|
|
127
|
+
opacity: var(--opacity-100),
|
|
128
|
+
// The floating label paints the field surface behind itself
|
|
129
|
+
--input-background-color: var(--input-disabled-background-color),
|
|
130
|
+
element: (
|
|
131
|
+
wrapper: (
|
|
132
|
+
background-color: var(--input-disabled-background-color),
|
|
133
|
+
border-color: var(--input-disabled-border-color),
|
|
134
|
+
state: (
|
|
135
|
+
hover: (
|
|
136
|
+
border-color: var(--input-disabled-border-color),
|
|
137
|
+
),
|
|
138
|
+
focus-within: (
|
|
139
|
+
border-color: var(--input-disabled-border-color),
|
|
140
|
+
box-shadow: none,
|
|
141
|
+
),
|
|
142
|
+
),
|
|
143
|
+
),
|
|
144
|
+
),
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
// The dimmed text of a disabled field, on its control element
|
|
148
|
+
@function -disabled-control($element) {
|
|
149
|
+
@return (
|
|
150
|
+
state: (
|
|
151
|
+
disabled: (
|
|
152
|
+
element: (
|
|
153
|
+
#{$element}: (
|
|
154
|
+
color: var(--input-disabled-color),
|
|
155
|
+
),
|
|
156
|
+
),
|
|
157
|
+
),
|
|
158
|
+
),
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Read only: looks like rest, ignores hover and focus
|
|
163
|
+
$-readonly: (
|
|
164
|
+
element: (
|
|
165
|
+
wrapper: (
|
|
166
|
+
state: (
|
|
167
|
+
hover: (
|
|
168
|
+
border-color: var(--input-border-color),
|
|
169
|
+
),
|
|
170
|
+
focus-within: (
|
|
171
|
+
border-color: var(--input-border-color),
|
|
172
|
+
box-shadow: none,
|
|
173
|
+
),
|
|
174
|
+
),
|
|
175
|
+
),
|
|
176
|
+
),
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
// The floated label shrinks to its own line, sits on the top border with the
|
|
180
|
+
// field surface behind it and a little air on each side: the border is
|
|
181
|
+
// interrupted by the label, the notch of an outlined field
|
|
182
|
+
$-floating-label: (
|
|
183
|
+
top: 0,
|
|
184
|
+
min-height: 0,
|
|
185
|
+
line-height: var(--leading-normal),
|
|
186
|
+
padding-inline: var(--spacing-4),
|
|
187
|
+
margin-left: calc(-1 * var(--spacing-4)),
|
|
188
|
+
// Plain: the disabled state sets `--input-background-color` on the
|
|
189
|
+
// block, which a generated property, resolved at the root, would miss
|
|
190
|
+
[background-color]: var(--input-background-color),
|
|
191
|
+
);
|
|
192
|
+
$-floating: (
|
|
193
|
+
state: (
|
|
194
|
+
focus-within: (
|
|
195
|
+
element: (
|
|
196
|
+
label: $-floating-label,
|
|
197
|
+
),
|
|
198
|
+
),
|
|
199
|
+
dirty: (
|
|
200
|
+
element: (
|
|
201
|
+
label: $-floating-label,
|
|
202
|
+
),
|
|
203
|
+
),
|
|
204
|
+
),
|
|
205
|
+
);
|
|
206
|
+
|
|
207
|
+
// The select spells "dirty" as a modifier rather than a state
|
|
208
|
+
$-floating-select: (
|
|
209
|
+
state: (
|
|
210
|
+
focus-within: (
|
|
211
|
+
element: (
|
|
212
|
+
label: $-floating-label,
|
|
213
|
+
),
|
|
214
|
+
),
|
|
215
|
+
),
|
|
216
|
+
modifier: (
|
|
217
|
+
dirty: (
|
|
218
|
+
element: (
|
|
219
|
+
label: $-floating-label,
|
|
220
|
+
),
|
|
221
|
+
),
|
|
222
|
+
),
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
// What every field takes
|
|
226
|
+
$-field: (
|
|
227
|
+
element: (
|
|
228
|
+
wrapper: $-wrapper,
|
|
229
|
+
),
|
|
230
|
+
modifier: (
|
|
231
|
+
valid: (
|
|
232
|
+
element: (
|
|
233
|
+
wrapper: $-wrapper-valid,
|
|
234
|
+
),
|
|
235
|
+
),
|
|
236
|
+
invalid: (
|
|
237
|
+
element: (
|
|
238
|
+
wrapper: $-wrapper-invalid,
|
|
239
|
+
),
|
|
240
|
+
),
|
|
241
|
+
loading: (
|
|
242
|
+
element: (
|
|
243
|
+
wrapper: $-wrapper-loading,
|
|
244
|
+
),
|
|
245
|
+
),
|
|
246
|
+
),
|
|
247
|
+
state: (
|
|
248
|
+
disabled: $-disabled,
|
|
249
|
+
),
|
|
250
|
+
);
|
|
251
|
+
|
|
252
|
+
// A text input and a textarea: the field, the floating label, read only
|
|
253
|
+
$-text-like: map.deep-merge(
|
|
254
|
+
map.deep-merge($-field, -disabled-control('input')),
|
|
255
|
+
(
|
|
256
|
+
modifier: (
|
|
257
|
+
floating: $-floating,
|
|
258
|
+
),
|
|
259
|
+
state: (
|
|
260
|
+
readonly: $-readonly,
|
|
261
|
+
),
|
|
262
|
+
)
|
|
263
|
+
);
|
|
264
|
+
|
|
265
|
+
ctx.$vv-input-text: map.deep-merge(ctx.$vv-input-text, $-text-like);
|
|
266
|
+
ctx.$vv-textarea: map.deep-merge(ctx.$vv-textarea, $-text-like);
|
|
267
|
+
|
|
268
|
+
ctx.$vv-field: map.deep-merge(
|
|
269
|
+
ctx.$vv-field,
|
|
270
|
+
map.deep-merge(
|
|
271
|
+
map.deep-merge($-field, -disabled-control('control')),
|
|
272
|
+
(
|
|
273
|
+
state: (
|
|
274
|
+
readonly: $-readonly,
|
|
275
|
+
),
|
|
276
|
+
)
|
|
277
|
+
)
|
|
278
|
+
);
|
|
279
|
+
|
|
280
|
+
// The dashed border of the drop area is its `::after` at `inset: 0`, so the
|
|
281
|
+
// radius goes on both
|
|
282
|
+
ctx.$vv-input-file: map.deep-merge(
|
|
283
|
+
ctx.$vv-input-file,
|
|
284
|
+
map.deep-merge(
|
|
285
|
+
$-field,
|
|
286
|
+
(
|
|
287
|
+
element: (
|
|
288
|
+
drop-area: (
|
|
289
|
+
border-radius: var(--input-border-radius),
|
|
290
|
+
pseudo: (
|
|
291
|
+
after: (
|
|
292
|
+
// Plain: `inherit` written into a custom
|
|
293
|
+
// property would apply to the property itself
|
|
294
|
+
[border-radius]: inherit,
|
|
295
|
+
),
|
|
296
|
+
),
|
|
297
|
+
),
|
|
298
|
+
),
|
|
299
|
+
)
|
|
300
|
+
)
|
|
301
|
+
);
|
|
302
|
+
|
|
303
|
+
// The focus of a combobox sits on its dropdown, so the open state carries
|
|
304
|
+
// the ring as well, and read only freezes the control with the disabled
|
|
305
|
+
// attribute: the box is told it is at rest, not disabled
|
|
306
|
+
ctx.$vv-select: map.deep-merge(
|
|
307
|
+
ctx.$vv-select,
|
|
308
|
+
map.deep-merge(
|
|
309
|
+
map.deep-merge($-field, -disabled-control('input')),
|
|
310
|
+
(
|
|
311
|
+
element: (
|
|
312
|
+
wrapper: (
|
|
313
|
+
state: (
|
|
314
|
+
open: (
|
|
315
|
+
border-color: var(--input-focus-color),
|
|
316
|
+
box-shadow: var(--input-focus-ring),
|
|
317
|
+
),
|
|
318
|
+
),
|
|
319
|
+
),
|
|
320
|
+
),
|
|
321
|
+
modifier: (
|
|
322
|
+
floating: $-floating-select,
|
|
323
|
+
readonly: (
|
|
324
|
+
element: (
|
|
325
|
+
input: (
|
|
326
|
+
color: var(--color-word-1),
|
|
327
|
+
),
|
|
328
|
+
wrapper: (
|
|
329
|
+
background-color: var(--input-background-color),
|
|
330
|
+
border-color: var(--input-border-color),
|
|
331
|
+
state: (
|
|
332
|
+
hover: (
|
|
333
|
+
border-color: var(--input-border-color),
|
|
334
|
+
),
|
|
335
|
+
focus-within: (
|
|
336
|
+
border-color: var(--input-border-color),
|
|
337
|
+
box-shadow: none,
|
|
338
|
+
),
|
|
339
|
+
),
|
|
340
|
+
),
|
|
341
|
+
),
|
|
342
|
+
),
|
|
343
|
+
),
|
|
344
|
+
)
|
|
345
|
+
)
|
|
346
|
+
);
|
package/src/props/colors.scss
CHANGED
|
@@ -3,5 +3,11 @@
|
|
|
3
3
|
@include layer(props, $use-css-layers, $layer-prefix) {
|
|
4
4
|
:where(:host, :root, .theme) {
|
|
5
5
|
@include spread-map-into-props($colors, $prefix: color);
|
|
6
|
+
|
|
7
|
+
// Safari 17 reads `l` as a percentage: the fixed steps of word and
|
|
8
|
+
// surface, calc(l + 12), resolve there only written in percent
|
|
9
|
+
@supports not (color: hsl(from red h s calc(l + 1))) {
|
|
10
|
+
@include spread-map-into-props(fixed-steps-in-percent($colors), $prefix: color);
|
|
11
|
+
}
|
|
6
12
|
}
|
|
7
13
|
}
|
package/src/props/index.scss
CHANGED
|
@@ -6,8 +6,11 @@
|
|
|
6
6
|
@use 'filters';
|
|
7
7
|
@use 'input';
|
|
8
8
|
@use 'layout';
|
|
9
|
-
@use 'media';
|
|
10
9
|
@use 'sizing';
|
|
11
10
|
@use 'spacing';
|
|
12
11
|
@use 'transitions';
|
|
13
12
|
@use 'typography';
|
|
13
|
+
|
|
14
|
+
// `media` is left out on purpose: `@custom-media` needs a build step to be
|
|
15
|
+
// resolved, and without one a minifier warns about every rule. A consumer
|
|
16
|
+
// whose pipeline resolves them imports `scss/props/media` on its own.
|
package/src/props/media.scss
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
@use '../context' as *;
|
|
2
2
|
|
|
3
|
+
// Opt-in, left out of `props/index.scss`: `@custom-media` is a draft that has
|
|
4
|
+
// to be resolved at build time (postcss-custom-media, or lightningcss with
|
|
5
|
+
// `drafts.customMedia`), and each resolver reads the definitions of the file
|
|
6
|
+
// it is transforming, so import this module where the queries are used.
|
|
7
|
+
|
|
3
8
|
// motion
|
|
4
9
|
@custom-media --motion-ok (prefers-reduced-motion: no-preference);
|
|
5
10
|
@custom-media --motion-not-ok (prefers-reduced-motion: reduce);
|
|
@@ -16,7 +21,7 @@
|
|
|
16
21
|
@custom-media --os-dark (prefers-color-scheme: dark);
|
|
17
22
|
@custom-media --os-light (prefers-color-scheme: light);
|
|
18
23
|
|
|
19
|
-
//
|
|
24
|
+
// contrast
|
|
20
25
|
@custom-media --high-contrast (prefers-contrast: more);
|
|
21
26
|
@custom-media --low-contrast (prefers-contrast: less);
|
|
22
27
|
|
|
@@ -33,17 +38,27 @@
|
|
|
33
38
|
@custom-media --pointer (hover) and (pointer: coarse);
|
|
34
39
|
@custom-media --mouse (hover) and (pointer: fine);
|
|
35
40
|
|
|
36
|
-
// breakpoints
|
|
37
|
-
|
|
41
|
+
// breakpoints: the same widths as the `bp-only`, `bp-up` and `bp-down`
|
|
42
|
+
// mixins. A range stops short of the next breakpoint instead of sharing its
|
|
43
|
+
// first pixel, and the last breakpoint has no upper bound.
|
|
44
|
+
// stylelint-disable custom-media-pattern
|
|
38
45
|
$old-breakpoint: null;
|
|
39
46
|
$old-breakpoint-value: null;
|
|
47
|
+
|
|
40
48
|
@each $breakpoint, $breakpoint-value in $breakpoints {
|
|
41
49
|
@if $old-breakpoint {
|
|
42
|
-
@custom-media --#{$old-breakpoint}-only (#{$old-breakpoint-value} <= width
|
|
43
|
-
@custom-media --#{$old-breakpoint}-n-
|
|
44
|
-
@custom-media --#{$old-breakpoint}-n-below (width <= #{$breakpoint-value});
|
|
50
|
+
@custom-media --#{$old-breakpoint}-only (#{$old-breakpoint-value} <= width < #{$breakpoint-value});
|
|
51
|
+
@custom-media --#{$old-breakpoint}-n-below (width < #{$breakpoint-value});
|
|
45
52
|
}
|
|
46
53
|
|
|
54
|
+
@custom-media --#{$breakpoint}-n-above (width >= #{$breakpoint-value});
|
|
55
|
+
|
|
47
56
|
$old-breakpoint: $breakpoint;
|
|
48
57
|
$old-breakpoint-value: $breakpoint-value;
|
|
49
58
|
}
|
|
59
|
+
|
|
60
|
+
@if $old-breakpoint {
|
|
61
|
+
@custom-media --#{$old-breakpoint}-only (width >= #{$old-breakpoint-value});
|
|
62
|
+
@custom-media --#{$old-breakpoint}-n-below (width >= 0);
|
|
63
|
+
}
|
|
64
|
+
// stylelint-enable custom-media-pattern
|