@volverjs/style 0.1.29 → 0.1.30
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 +64 -16
- package/src/_config.scss +23 -0
- package/src/_preflight.scss +14 -2
- package/src/base.scss +1 -1
- 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/settings/_colors.scss +161 -61
- package/src/settings/_index.scss +26 -0
- package/src/settings/_input.scss +11 -2
- 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 +19 -9
- package/src/settings/components/_vv-badge.scss +47 -14
- 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 +55 -13
- 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 +8 -3
- 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 +3 -2
- 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 +8 -8
- package/src/settings/components/_vv-input-otp.scss +55 -0
- package/src/settings/components/_vv-input-range.scss +3 -3
- package/src/settings/components/_vv-input-text.scss +7 -7
- 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 +7 -3
- package/src/settings/components/_vv-select.scss +6 -6
- 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 +3 -3
- package/src/settings/components/_vv-textarea.scss +7 -7
- 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/_input.scss +4 -8
- 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 -15
- 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,91 @@
|
|
|
1
|
+
// The width of the collapsed sidebar, read by the block and by its sections
|
|
2
|
+
$-rail-width: var(--sidebar-collapsed-width, var(--spacing-64));
|
|
3
|
+
|
|
4
|
+
// A section of the rail is one column as wide as the rail, anchored at its
|
|
5
|
+
// start, with what is left in it centred: the icons of the header, of the
|
|
6
|
+
// navigation and of the footer line up on the middle of the rail, whatever
|
|
7
|
+
// padding each of them carries. The column keeps that width while the rail is
|
|
8
|
+
// still narrowing, so the icons stay where they land instead of riding the
|
|
9
|
+
// middle of a column that shrinks. `minmax(0, ...)` gives up the pixel of the
|
|
10
|
+
// border at rest, where the section is that much narrower than the rail.
|
|
11
|
+
$-rail-section: (
|
|
12
|
+
display: grid,
|
|
13
|
+
align-content: start,
|
|
14
|
+
justify-items: center,
|
|
15
|
+
padding-inline: 0,
|
|
16
|
+
[grid-template-columns]: minmax(0, $-rail-width),
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
// The side column of an application: a `header` (the product, a switcher), a
|
|
20
|
+
// `content` that scrolls (a `vv-nav--sidebar`), a `footer` (the account).
|
|
21
|
+
// Its width is `--sidebar-width`, 16rem when nothing sets it; `collapsed`
|
|
22
|
+
// narrows it to `--sidebar-collapsed-width`, a 64px rail, and hides every
|
|
23
|
+
// `label` from sight, so the icons of the navigation remain and still carry
|
|
24
|
+
// their names. Both are read with a
|
|
25
|
+
// fallback and never declared on the block, so a value set on the layout
|
|
26
|
+
// around it reaches it.
|
|
27
|
+
$vv-sidebar: (
|
|
28
|
+
display: flex,
|
|
29
|
+
flex-direction: column,
|
|
30
|
+
// Its width is the one set, even beside a main column that overflows
|
|
31
|
+
flex-shrink: 0,
|
|
32
|
+
block-size: 100%,
|
|
33
|
+
min-block-size: 0,
|
|
34
|
+
border-inline-end: var(--border) solid var(--color-surface-3),
|
|
35
|
+
background-color: var(--color-surface-1),
|
|
36
|
+
color: var(--color-word-2),
|
|
37
|
+
transition: inline-size var(--duration-300) var(--ease-out),
|
|
38
|
+
[inline-size]: var(--sidebar-width, 16rem),
|
|
39
|
+
element: (
|
|
40
|
+
header: (
|
|
41
|
+
display: flex,
|
|
42
|
+
flex-shrink: 0,
|
|
43
|
+
align-items: center,
|
|
44
|
+
gap: var(--spacing-8),
|
|
45
|
+
min-width: 0,
|
|
46
|
+
padding: var(--spacing-sm),
|
|
47
|
+
),
|
|
48
|
+
content: (
|
|
49
|
+
flex: 1,
|
|
50
|
+
min-height: 0,
|
|
51
|
+
padding: var(--spacing-xs) var(--spacing-sm),
|
|
52
|
+
overflow-y: auto,
|
|
53
|
+
scrollbar-width: thin,
|
|
54
|
+
),
|
|
55
|
+
footer: (
|
|
56
|
+
display: flex,
|
|
57
|
+
flex-shrink: 0,
|
|
58
|
+
align-items: center,
|
|
59
|
+
gap: var(--spacing-8),
|
|
60
|
+
min-width: 0,
|
|
61
|
+
padding: var(--spacing-sm),
|
|
62
|
+
border-top: var(--border) solid var(--color-surface-3),
|
|
63
|
+
),
|
|
64
|
+
label: (
|
|
65
|
+
min-width: 0,
|
|
66
|
+
overflow: hidden,
|
|
67
|
+
text-overflow: ellipsis,
|
|
68
|
+
white-space: nowrap,
|
|
69
|
+
),
|
|
70
|
+
),
|
|
71
|
+
modifier: (
|
|
72
|
+
// The labels leave the rail but stay in the accessibility tree, so an
|
|
73
|
+
// icon keeps the name of its link
|
|
74
|
+
collapsed: (
|
|
75
|
+
[inline-size]: $-rail-width,
|
|
76
|
+
element: (
|
|
77
|
+
header: $-rail-section,
|
|
78
|
+
content: $-rail-section,
|
|
79
|
+
footer: $-rail-section,
|
|
80
|
+
label: (
|
|
81
|
+
position: absolute,
|
|
82
|
+
inline-size: var(--spacing-1),
|
|
83
|
+
block-size: var(--spacing-1),
|
|
84
|
+
overflow: hidden,
|
|
85
|
+
clip-path: inset(50%),
|
|
86
|
+
white-space: nowrap,
|
|
87
|
+
),
|
|
88
|
+
),
|
|
89
|
+
),
|
|
90
|
+
),
|
|
91
|
+
) !default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// A ring that turns while something is loading. It measures `1em` and draws
|
|
2
|
+
// in `currentcolor`, so it takes the size and the colour of the text it sits
|
|
3
|
+
// in: inside a button, next to a label, or alone with a text utility on it.
|
|
4
|
+
|
|
5
|
+
// The animation tokens are `none` under `prefers-reduced-motion`, and a
|
|
6
|
+
// spinner that stands still says nothing, so the block runs `spin` itself
|
|
7
|
+
// and slows it down there instead (see `src/components/vv-spinner.scss`).
|
|
8
|
+
// `--spinner-duration` and `--spinner-thickness` are read by plain
|
|
9
|
+
// declarations, in brackets: a `var()` inside a generated custom property is
|
|
10
|
+
// substituted where that property is declared, at the root, and would never
|
|
11
|
+
// see a value set on the block.
|
|
12
|
+
$vv-spinner: (
|
|
13
|
+
--spinner-duration: 0.75s,
|
|
14
|
+
--spinner-thickness: 0.125em,
|
|
15
|
+
display: inline-block,
|
|
16
|
+
flex-shrink: 0,
|
|
17
|
+
inline-size: 1em,
|
|
18
|
+
block-size: 1em,
|
|
19
|
+
border-style: solid,
|
|
20
|
+
border-color: color-mix(in srgb, currentcolor 20%, transparent),
|
|
21
|
+
border-block-start-color: currentcolor,
|
|
22
|
+
border-radius: var(--rounded-full),
|
|
23
|
+
vertical-align: middle,
|
|
24
|
+
[border-width]: var(--spinner-thickness),
|
|
25
|
+
[animation]: spin var(--spinner-duration) linear infinite,
|
|
26
|
+
) !default;
|
|
@@ -27,12 +27,45 @@ $vv-table: (
|
|
|
27
27
|
last-child: (
|
|
28
28
|
border-width: 0,
|
|
29
29
|
),
|
|
30
|
+
// A row picked in a table that selects (`aria-selected`)
|
|
31
|
+
selected: (
|
|
32
|
+
background-color: var(--color-surface-1),
|
|
33
|
+
),
|
|
34
|
+
// The row being looked at, the table as a master list: a
|
|
35
|
+
// surface that stands apart and a bar along the inline start,
|
|
36
|
+
// as `vv-item--current` draws it. Plain markup puts `current`
|
|
37
|
+
// on the `tr`.
|
|
38
|
+
current: (
|
|
39
|
+
background-color: var(--color-surface-2),
|
|
40
|
+
// On the inline start: `--direction` is -1 in a right to left page
|
|
41
|
+
[box-shadow]: inset calc(var(--spacing-3) * var(--direction, 1)) 0 0 var(--color-word-2),
|
|
42
|
+
),
|
|
30
43
|
),
|
|
31
44
|
),
|
|
32
45
|
tfoot-tr: (
|
|
33
46
|
_alias: 'tfoot > tr',
|
|
34
47
|
border-width: 1px 0 0 0,
|
|
35
48
|
),
|
|
49
|
+
// A sortable column carries `aria-sort` on the `th` and a
|
|
50
|
+
// `vv-table__sort` button inside it. The indicator is the chevron of
|
|
51
|
+
// the library, drawn as a mask in the colour of the text after the
|
|
52
|
+
// button, faint while the column is not sorted. Declared before `th`,
|
|
53
|
+
// whose sorted states follow it.
|
|
54
|
+
sortable: (
|
|
55
|
+
_alias: 'th[aria-sort]',
|
|
56
|
+
pseudo: (
|
|
57
|
+
after: (
|
|
58
|
+
display: inline-block,
|
|
59
|
+
width: 0.75em,
|
|
60
|
+
height: 0.75em,
|
|
61
|
+
margin-inline-start: 0.25em,
|
|
62
|
+
vertical-align: middle,
|
|
63
|
+
background-color: currentcolor,
|
|
64
|
+
mask: var(--bg-chevron) center / contain no-repeat,
|
|
65
|
+
opacity: var(--opacity-40),
|
|
66
|
+
),
|
|
67
|
+
),
|
|
68
|
+
),
|
|
36
69
|
th: (
|
|
37
70
|
_alias: 'th',
|
|
38
71
|
font-weight: var(--font-semibold),
|
|
@@ -40,6 +73,36 @@ $vv-table: (
|
|
|
40
73
|
color: var(--color-word-2),
|
|
41
74
|
vertical-align: middle,
|
|
42
75
|
[padding]: var(--table-cell-padding),
|
|
76
|
+
// Sorted: the indicator of `sortable` above, full strength,
|
|
77
|
+
// pointing down for descending and up for ascending
|
|
78
|
+
state: (
|
|
79
|
+
sort-descending: (
|
|
80
|
+
pseudo: (
|
|
81
|
+
after: (
|
|
82
|
+
opacity: var(--opacity-100),
|
|
83
|
+
),
|
|
84
|
+
),
|
|
85
|
+
),
|
|
86
|
+
sort-ascending: (
|
|
87
|
+
pseudo: (
|
|
88
|
+
after: (
|
|
89
|
+
opacity: var(--opacity-100),
|
|
90
|
+
rotate: 180deg,
|
|
91
|
+
),
|
|
92
|
+
),
|
|
93
|
+
),
|
|
94
|
+
),
|
|
95
|
+
),
|
|
96
|
+
sort: (
|
|
97
|
+
display: inline-flex,
|
|
98
|
+
align-items: center,
|
|
99
|
+
cursor: pointer,
|
|
100
|
+
state: (
|
|
101
|
+
focus-visible: (
|
|
102
|
+
outline: var(--spacing-px) solid var(--color-brand-graphic),
|
|
103
|
+
outline-offset: var(--spacing-2),
|
|
104
|
+
),
|
|
105
|
+
),
|
|
43
106
|
),
|
|
44
107
|
td: (
|
|
45
108
|
_alias: 'td',
|
|
@@ -15,10 +15,10 @@ $vv-text: (
|
|
|
15
15
|
margin-block: var(--spacing-16),
|
|
16
16
|
),
|
|
17
17
|
link: (
|
|
18
|
-
color: var(--color-brand),
|
|
18
|
+
color: var(--color-brand-readable),
|
|
19
19
|
state: (
|
|
20
20
|
focus-visible: (
|
|
21
|
-
outline: var(--spacing-px) solid var(--color-brand),
|
|
21
|
+
outline: var(--spacing-px) solid var(--color-brand-graphic),
|
|
22
22
|
outline-offset: var(--spacing-4),
|
|
23
23
|
),
|
|
24
24
|
hover: (
|
|
@@ -26,7 +26,7 @@ $vv-text: (
|
|
|
26
26
|
text-underline-offset: var(--spacing-4),
|
|
27
27
|
),
|
|
28
28
|
active: (
|
|
29
|
-
color: var(--color-brand-
|
|
29
|
+
color: var(--color-brand-readable-strong),
|
|
30
30
|
),
|
|
31
31
|
disabled: (
|
|
32
32
|
opacity: var(--opacity-50),
|
|
@@ -53,7 +53,7 @@ $vv-textarea: (
|
|
|
53
53
|
position: absolute,
|
|
54
54
|
height: var(--spacing-2),
|
|
55
55
|
inset: auto 0 0 0,
|
|
56
|
-
background: var(--color-brand),
|
|
56
|
+
background: var(--color-brand-graphic),
|
|
57
57
|
scale: 0 1,
|
|
58
58
|
transform-origin: left,
|
|
59
59
|
will-change: transform,
|
|
@@ -174,13 +174,13 @@ $vv-textarea: (
|
|
|
174
174
|
),
|
|
175
175
|
),
|
|
176
176
|
hint: (
|
|
177
|
-
color: var(--input-valid-color),
|
|
177
|
+
color: var(--input-valid-text-color),
|
|
178
178
|
),
|
|
179
179
|
limit: (
|
|
180
|
-
color: var(--input-valid-color),
|
|
180
|
+
color: var(--input-valid-text-color),
|
|
181
181
|
),
|
|
182
182
|
icon-after: (
|
|
183
|
-
color: var(--input-valid-color),
|
|
183
|
+
color: var(--input-valid-text-color),
|
|
184
184
|
),
|
|
185
185
|
),
|
|
186
186
|
),
|
|
@@ -195,13 +195,13 @@ $vv-textarea: (
|
|
|
195
195
|
),
|
|
196
196
|
),
|
|
197
197
|
hint: (
|
|
198
|
-
color: var(--input-invalid-color),
|
|
198
|
+
color: var(--input-invalid-text-color),
|
|
199
199
|
),
|
|
200
200
|
limit: (
|
|
201
|
-
color: var(--input-invalid-color),
|
|
201
|
+
color: var(--input-invalid-text-color),
|
|
202
202
|
),
|
|
203
203
|
icon-after: (
|
|
204
|
-
color: var(--input-invalid-color),
|
|
204
|
+
color: var(--input-invalid-text-color),
|
|
205
205
|
),
|
|
206
206
|
),
|
|
207
207
|
),
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../context' as *;
|
|
3
|
+
|
|
4
|
+
$component-name: map.get($components-names, vv-checkbox);
|
|
5
|
+
|
|
6
|
+
@mixin theme-dark-vv-checkbox {
|
|
7
|
+
@include spread-theme-component(
|
|
8
|
+
$base-map: $vv-checkbox,
|
|
9
|
+
$theme-map: $dark-vv-checkbox,
|
|
10
|
+
$component-name: $component-name,
|
|
11
|
+
$bps: $breakpoints,
|
|
12
|
+
$use-custom-props: $use-custom-props-for-components,
|
|
13
|
+
$zero-specificity: $zero-specificity-for-components
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@include layer(themes, $use-css-layers, $layer-prefix) {
|
|
18
|
+
:where(:host, :root, .theme):not(.theme--light) {
|
|
19
|
+
@media (prefers-color-scheme: dark) {
|
|
20
|
+
@include theme-dark-vv-checkbox;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:where(.theme.theme--dark) {
|
|
25
|
+
@include theme-dark-vv-checkbox;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../context' as *;
|
|
3
|
+
|
|
4
|
+
$component-name: map.get($components-names, vv-radio);
|
|
5
|
+
|
|
6
|
+
@mixin theme-dark-vv-radio {
|
|
7
|
+
@include spread-theme-component(
|
|
8
|
+
$base-map: $vv-radio,
|
|
9
|
+
$theme-map: $dark-vv-radio,
|
|
10
|
+
$component-name: $component-name,
|
|
11
|
+
$bps: $breakpoints,
|
|
12
|
+
$use-custom-props: $use-custom-props-for-components,
|
|
13
|
+
$zero-specificity: $zero-specificity-for-components
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@include layer(themes, $use-css-layers, $layer-prefix) {
|
|
18
|
+
:where(:host, :root, .theme):not(.theme--light) {
|
|
19
|
+
@media (prefers-color-scheme: dark) {
|
|
20
|
+
@include theme-dark-vv-radio;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:where(.theme.theme--dark) {
|
|
25
|
+
@include theme-dark-vv-radio;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
@mixin theme-dark-colors {
|
|
4
4
|
@include spread-map-into-props($dark-colors, 'color');
|
|
5
|
+
|
|
6
|
+
// Safari 17 reads `l` as a percentage: the fixed steps of word and
|
|
7
|
+
// surface, calc(l - 12), resolve there only written in percent
|
|
8
|
+
@supports not (color: hsl(from red h s calc(l + 1))) {
|
|
9
|
+
@include spread-map-into-props(fixed-steps-in-percent($dark-colors), 'color');
|
|
10
|
+
}
|
|
5
11
|
}
|
|
6
12
|
|
|
7
13
|
@include layer(themes, $use-css-layers, $layer-prefix) {
|
|
@@ -7,49 +7,114 @@
|
|
|
7
7
|
@use '../../../config' as config;
|
|
8
8
|
|
|
9
9
|
$dark-color-scheme: dark !default;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
|
|
11
|
+
// Hue from the light tint, as in the light theme: --color-tint is not
|
|
12
|
+
// redeclared here, so a dark brand does not move the neutrals.
|
|
13
|
+
$dark-color-word: hsl(color-hue($color-tint) 15% 85%) !default;
|
|
14
|
+
$dark-color-surface: hsl(color-hue($color-tint) 10% 5%) !default;
|
|
15
|
+
|
|
16
|
+
// Lightness of the tinted surfaces in the dark theme
|
|
17
|
+
$dark-color-surface-tint-lightness: 10% !default;
|
|
18
|
+
|
|
19
|
+
// Lightness between two neutral surfaces in the dark theme
|
|
20
|
+
$dark-color-surface-scale: 5% !default;
|
|
21
|
+
|
|
22
|
+
// `readable-strong` in the dark theme: `readable` with its luminance scaled
|
|
23
|
+
// by this, toward white. The text roles are redeclared here, so they follow
|
|
24
|
+
// the theme in every component and a light rule needs no dark override for
|
|
25
|
+
// its text color.
|
|
26
|
+
$dark-color-readable-strong-factor: 1.5 !default;
|
|
27
|
+
|
|
28
|
+
// The luminance the roles are moved to, on the neutral surfaces down to
|
|
29
|
+
// $color-readable-depth and on the hardest tinted surface of any hue, as in
|
|
30
|
+
// the light theme
|
|
31
|
+
$dark-color-readable-luminance: readable-luminance(
|
|
32
|
+
readable-surface($dark-color-surface, $color-readable-depth * $dark-color-surface-scale),
|
|
33
|
+
$color-readable-ratio
|
|
34
|
+
) !default;
|
|
35
|
+
$dark-color-surface-readable-luminance: readable-luminance(
|
|
36
|
+
readable-worst-tint($dark-color-surface-tint-lightness),
|
|
37
|
+
$color-readable-ratio
|
|
38
|
+
) !default;
|
|
39
|
+
$dark-color-graphic-luminance: readable-luminance(
|
|
40
|
+
readable-surface($dark-color-surface, $color-readable-depth * $dark-color-surface-scale),
|
|
41
|
+
$color-graphic-ratio
|
|
42
|
+
) !default;
|
|
12
43
|
|
|
13
44
|
// Surface palette for dark theme
|
|
14
45
|
$dark-color-surface-palette: if(
|
|
15
46
|
sass(config.$use-color-mix):
|
|
16
47
|
(
|
|
17
|
-
brand: string.unquote('hsl(from var(--color-brand) h s
|
|
18
|
-
accent: string.unquote('hsl(from var(--color-accent) h s
|
|
19
|
-
success: string.unquote('hsl(from var(--color-success) h s
|
|
20
|
-
danger: string.unquote('hsl(from var(--color-danger) h s
|
|
21
|
-
info: string.unquote('hsl(from var(--color-info) h s
|
|
22
|
-
warning: string.unquote('hsl(from var(--color-warning) h s
|
|
48
|
+
brand: string.unquote('hsl(from var(--color-brand) h s #{$dark-color-surface-tint-lightness})'),
|
|
49
|
+
accent: string.unquote('hsl(from var(--color-accent) h s #{$dark-color-surface-tint-lightness})'),
|
|
50
|
+
success: string.unquote('hsl(from var(--color-success) h s #{$dark-color-surface-tint-lightness})'),
|
|
51
|
+
danger: string.unquote('hsl(from var(--color-danger) h s #{$dark-color-surface-tint-lightness})'),
|
|
52
|
+
info: string.unquote('hsl(from var(--color-info) h s #{$dark-color-surface-tint-lightness})'),
|
|
53
|
+
warning: string.unquote('hsl(from var(--color-warning) h s #{$dark-color-surface-tint-lightness})'),
|
|
23
54
|
);
|
|
24
55
|
else:
|
|
25
56
|
(
|
|
26
|
-
brand: hsl(var(--color-brand-hue) var(--color-brand-saturation)
|
|
27
|
-
accent: hsl(var(--color-accent-hue) var(--color-accent-saturation)
|
|
28
|
-
success: hsl(var(--color-success-hue) var(--color-success-saturation)
|
|
29
|
-
danger: hsl(var(--color-danger-hue) var(--color-danger-saturation)
|
|
30
|
-
info: hsl(var(--color-info-hue) var(--color-info-saturation)
|
|
31
|
-
warning: hsl(var(--color-warning-hue) var(--color-warning-saturation)
|
|
57
|
+
brand: hsl(var(--color-brand-hue) var(--color-brand-saturation) $dark-color-surface-tint-lightness),
|
|
58
|
+
accent: hsl(var(--color-accent-hue) var(--color-accent-saturation) $dark-color-surface-tint-lightness),
|
|
59
|
+
success: hsl(var(--color-success-hue) var(--color-success-saturation) $dark-color-surface-tint-lightness),
|
|
60
|
+
danger: hsl(var(--color-danger-hue) var(--color-danger-saturation) $dark-color-surface-tint-lightness),
|
|
61
|
+
info: hsl(var(--color-info-hue) var(--color-info-saturation) $dark-color-surface-tint-lightness),
|
|
62
|
+
warning: hsl(var(--color-warning-hue) var(--color-warning-saturation) $dark-color-surface-tint-lightness),
|
|
32
63
|
)
|
|
33
64
|
) !default;
|
|
34
65
|
|
|
35
66
|
// color map
|
|
36
|
-
$dark-colors:
|
|
37
|
-
|
|
38
|
-
(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
67
|
+
$dark-colors: map.deep-merge(
|
|
68
|
+
if(
|
|
69
|
+
sass(config.$use-color-mix):
|
|
70
|
+
(
|
|
71
|
+
scheme: $dark-color-scheme,
|
|
72
|
+
word: color-mix-darken-map(
|
|
73
|
+
tinted-neutral-value($dark-color-word, $color-tint, 15%, 85%),
|
|
74
|
+
'word',
|
|
75
|
+
$steps: 5,
|
|
76
|
+
$scale: 12%
|
|
77
|
+
),
|
|
78
|
+
surface: map.merge(
|
|
79
|
+
color-mix-lighten-map(
|
|
80
|
+
tinted-neutral-value($dark-color-surface, $color-tint, 10%, 5%),
|
|
81
|
+
'surface',
|
|
82
|
+
$steps: 5,
|
|
83
|
+
$scale: $dark-color-surface-scale
|
|
84
|
+
),
|
|
85
|
+
$dark-color-surface-palette
|
|
86
|
+
),
|
|
87
|
+
);
|
|
88
|
+
else:
|
|
89
|
+
(
|
|
90
|
+
scheme: $dark-color-scheme,
|
|
91
|
+
word: color-darken-map($dark-color-word, 'word', $scale: 12%, $fixed: true),
|
|
92
|
+
surface: map.merge(
|
|
93
|
+
color-lighten-map(
|
|
94
|
+
$dark-color-surface,
|
|
95
|
+
'surface',
|
|
96
|
+
$scale: $dark-color-surface-scale,
|
|
97
|
+
$fixed: true,
|
|
98
|
+
$inverted: false
|
|
99
|
+
),
|
|
100
|
+
$dark-color-surface-palette
|
|
101
|
+
),
|
|
102
|
+
)
|
|
103
|
+
),
|
|
104
|
+
readable-roles(
|
|
47
105
|
(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
)
|
|
106
|
+
brand: $color-brand,
|
|
107
|
+
accent: $color-accent,
|
|
108
|
+
success: $color-success,
|
|
109
|
+
danger: $color-danger,
|
|
110
|
+
info: $color-info,
|
|
111
|
+
warning: $color-warning,
|
|
112
|
+
),
|
|
113
|
+
$dark-color-readable-luminance,
|
|
114
|
+
$dark-color-surface-readable-luminance,
|
|
115
|
+
$dark-color-graphic-luminance,
|
|
116
|
+
$dark-color-readable-strong-factor,
|
|
117
|
+
$lighten: color-luminance($dark-color-surface) < contrast-threshold(),
|
|
118
|
+
$relative: config.$use-color-mix
|
|
119
|
+
)
|
|
55
120
|
) !default;
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
@forward 'components/vv-avatar';
|
|
6
6
|
@forward 'components/vv-badge';
|
|
7
7
|
@forward 'components/vv-button';
|
|
8
|
+
@forward 'components/vv-checkbox';
|
|
8
9
|
@forward 'components/vv-dropdown-action';
|
|
9
10
|
@forward 'components/vv-dropdown-option';
|
|
10
11
|
@forward 'components/vv-nav';
|
|
12
|
+
@forward 'components/vv-radio';
|
|
11
13
|
@forward 'components/vv-select';
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
valid: (
|
|
6
|
-
color: var(--color-success-lighten-2),
|
|
7
|
-
),
|
|
8
|
-
) !default;
|
|
1
|
+
// The bars and the borders of a valid or invalid field read the graphic roles
|
|
2
|
+
// of success and danger, which the dark theme redeclares, so the fields
|
|
3
|
+
// follow it with nothing here
|
|
4
|
+
$dark-input: () !default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Dark values of the modifiers shared by `vv-radio` and `vv-checkbox`, like
|
|
2
|
+
// `src/settings/components/_choice.scss` on the light side. Loaded by both
|
|
3
|
+
// dark maps and not forwarded.
|
|
4
|
+
|
|
5
|
+
// The chosen tile of a segmented control is raised on the plain surface in
|
|
6
|
+
// the light theme. In the dark one the plain surface is the darkest colour
|
|
7
|
+
// there is and would read as a hole in the `surface-2` track, so the tile
|
|
8
|
+
// takes a lighter step instead.
|
|
9
|
+
$dark-choice-segment: (
|
|
10
|
+
state: (
|
|
11
|
+
checked-within: (
|
|
12
|
+
background-color: var(--color-surface-4),
|
|
13
|
+
),
|
|
14
|
+
),
|
|
15
|
+
);
|
|
@@ -12,48 +12,6 @@ $dark-vv-alert: (
|
|
|
12
12
|
),
|
|
13
13
|
),
|
|
14
14
|
),
|
|
15
|
-
success: (
|
|
16
|
-
element: (
|
|
17
|
-
header: (
|
|
18
|
-
color: var(--color-success-lighten-3),
|
|
19
|
-
),
|
|
20
|
-
),
|
|
21
|
-
),
|
|
22
|
-
warning: (
|
|
23
|
-
element: (
|
|
24
|
-
header: (
|
|
25
|
-
color: var(--color-warning),
|
|
26
|
-
),
|
|
27
|
-
),
|
|
28
|
-
),
|
|
29
|
-
danger: (
|
|
30
|
-
element: (
|
|
31
|
-
header: (
|
|
32
|
-
color: var(--color-danger-lighten-5),
|
|
33
|
-
),
|
|
34
|
-
),
|
|
35
|
-
),
|
|
36
|
-
accent: (
|
|
37
|
-
element: (
|
|
38
|
-
header: (
|
|
39
|
-
color: var(--color-accent-lighten-4),
|
|
40
|
-
),
|
|
41
|
-
),
|
|
42
|
-
),
|
|
43
|
-
brand: (
|
|
44
|
-
element: (
|
|
45
|
-
header: (
|
|
46
|
-
color: var(--color-brand-lighten-3),
|
|
47
|
-
),
|
|
48
|
-
),
|
|
49
|
-
),
|
|
50
|
-
info: (
|
|
51
|
-
element: (
|
|
52
|
-
header: (
|
|
53
|
-
color: var(--color-info),
|
|
54
|
-
),
|
|
55
|
-
),
|
|
56
|
-
),
|
|
57
15
|
notification: (
|
|
58
16
|
border-color: var(--color-gray-lighten-3),
|
|
59
17
|
modifier: (
|
|
@@ -61,7 +19,7 @@ $dark-vv-alert: (
|
|
|
61
19
|
border-color: var(--color-danger-lighten-3),
|
|
62
20
|
element: (
|
|
63
21
|
header: (
|
|
64
|
-
color: var(--color-
|
|
22
|
+
color: var(--color-danger-contrast)
|
|
65
23
|
),
|
|
66
24
|
),
|
|
67
25
|
),
|
|
@@ -69,7 +27,7 @@ $dark-vv-alert: (
|
|
|
69
27
|
border-color: var(--color-brand-lighten-3),
|
|
70
28
|
element: (
|
|
71
29
|
header: (
|
|
72
|
-
color: var(--color-
|
|
30
|
+
color: var(--color-brand-contrast)
|
|
73
31
|
),
|
|
74
32
|
),
|
|
75
33
|
),
|
|
@@ -77,7 +35,7 @@ $dark-vv-alert: (
|
|
|
77
35
|
border-color: var(--color-success-lighten-3),
|
|
78
36
|
element: (
|
|
79
37
|
header: (
|
|
80
|
-
color: var(--color-
|
|
38
|
+
color: var(--color-success-contrast)
|
|
81
39
|
),
|
|
82
40
|
),
|
|
83
41
|
),
|
|
@@ -85,7 +43,7 @@ $dark-vv-alert: (
|
|
|
85
43
|
border-color: var(--color-accent-lighten-3),
|
|
86
44
|
element: (
|
|
87
45
|
header: (
|
|
88
|
-
color: var(--color-
|
|
46
|
+
color: var(--color-accent-contrast)
|
|
89
47
|
),
|
|
90
48
|
),
|
|
91
49
|
),
|
|
@@ -93,7 +51,7 @@ $dark-vv-alert: (
|
|
|
93
51
|
border-color: var(--color-warning-darken-5),
|
|
94
52
|
element: (
|
|
95
53
|
header: (
|
|
96
|
-
color: var(--color-
|
|
54
|
+
color: var(--color-warning-darken-5-contrast),
|
|
97
55
|
background-color: var(--color-warning-darken-5),
|
|
98
56
|
),
|
|
99
57
|
),
|
|
@@ -102,7 +60,7 @@ $dark-vv-alert: (
|
|
|
102
60
|
border-color: var(--color-info-darken-2),
|
|
103
61
|
element: (
|
|
104
62
|
header: (
|
|
105
|
-
color: var(--color-
|
|
63
|
+
color: var(--color-info-darken-5-contrast),
|
|
106
64
|
background-color: var(--color-info-darken-5),
|
|
107
65
|
),
|
|
108
66
|
),
|
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
$dark-vv-avatar: (
|
|
2
2
|
modifier: (
|
|
3
|
+
// The colored rings take the readable roles, which follow the theme
|
|
3
4
|
ring: (
|
|
4
|
-
color: var(--color-brand-lighten-3),
|
|
5
5
|
modifier: (
|
|
6
|
-
danger: (
|
|
7
|
-
color: var(--color-danger-lighten-5),
|
|
8
|
-
),
|
|
9
|
-
success: (
|
|
10
|
-
color: var(--color-success-lighten-3),
|
|
11
|
-
),
|
|
12
|
-
warning: (
|
|
13
|
-
color: var(--color-warning),
|
|
14
|
-
),
|
|
15
6
|
gray: (
|
|
16
7
|
color: var(--color-gray-lighten-3),
|
|
17
8
|
),
|
|
18
|
-
info: (
|
|
19
|
-
color: var(--color-info),
|
|
20
|
-
),
|
|
21
|
-
accent: (
|
|
22
|
-
color: var(--color-accent-lighten-5),
|
|
23
|
-
),
|
|
24
9
|
surface: (
|
|
25
10
|
color: var(--color-word-2),
|
|
26
11
|
),
|