@rcarls/rc-theme-substrate 0.5.0 → 0.7.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/CHANGELOG.md +417 -0
- package/README.md +23 -0
- package/bridge.css +47 -17
- package/components/accordion.css +10 -111
- package/components/adaptive-menu.css +98 -0
- package/components/app-bar.css +1 -5
- package/components/bottom-sheet.css +1 -1
- package/components/carousel.css +31 -0
- package/components/chip-group.css +21 -0
- package/components/dialog.css +15 -11
- package/components/disclosure.css +56 -72
- package/components/fab-menu.css +3 -3
- package/components/field.css +155 -0
- package/components/list-item.css +36 -33
- package/components/listbox.css +4 -2
- package/components/markdown-editor.css +45 -32
- package/components/menu.css +11 -6
- package/components/modes.css +36 -0
- package/components/popover.css +13 -0
- package/components/progress.css +11 -0
- package/components/scroller.css +19 -0
- package/components/search-bar.css +3 -1
- package/components/segmented-button.css +2 -27
- package/components/select.css +21 -0
- package/components/splitter.css +27 -2
- package/components/textarea.css +3 -2
- package/components/toolbar.css +9 -4
- package/components/tooltip.css +15 -0
- package/components/transfer-list.css +3 -3
- package/components/virtual-canvas.css +10 -0
- package/components/virtual-scroller.css +7 -0
- package/components.css +11 -1
- package/css-components/button.css +66 -0
- package/css-components/card.css +14 -0
- package/css-components/chip-group.css +9 -0
- package/css-components/chip.css +80 -0
- package/css-components/disclosure.css +25 -0
- package/css-components/list.css +34 -0
- package/css-components/select.css +20 -0
- package/css-components/textarea.css +22 -0
- package/css-components.css +31 -0
- package/defaults.css +34 -5
- package/native.css +249 -0
- package/package.json +5 -1
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
@layer rc-theme-substrate.components {
|
|
2
|
+
/*
|
|
3
|
+
* rc-field already owns its own layout, invalid border, disabled opacity,
|
|
4
|
+
* focus outline, and forced-colors fallbacks, and it resets the slotted
|
|
5
|
+
* native control's chrome itself. Substrate only supplies its palette and
|
|
6
|
+
* the hover/focus polish its other form controls share, so the field reads
|
|
7
|
+
* as one of them rather than as a separate idiom.
|
|
8
|
+
*/
|
|
9
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-field {
|
|
10
|
+
/*
|
|
11
|
+
* The component is inline-block, so an unsized field shrink-wraps to its
|
|
12
|
+
* content: a provider-backed field with no value collapses to its chevron.
|
|
13
|
+
* Fill the container instead, capped so a field in a wide layout stays a
|
|
14
|
+
* readable measure.
|
|
15
|
+
*/
|
|
16
|
+
display: inline-block;
|
|
17
|
+
inline-size: min(100%, 28rem);
|
|
18
|
+
--rc-field-background: var(--substrate-field, Field);
|
|
19
|
+
--rc-field-color: var(--rc-field-text, FieldText);
|
|
20
|
+
--rc-field-border: var(--rc-border, 1px solid ButtonBorder);
|
|
21
|
+
--rc-field-radius: var(--rc-control-radius, 0.5rem);
|
|
22
|
+
--rc-field-min-block-size: var(--rc-control-block-size, 2.5rem);
|
|
23
|
+
--rc-field-padding: var(--rc-control-padding-block, 0.5rem)
|
|
24
|
+
var(--rc-control-padding-inline, 0.75rem);
|
|
25
|
+
--rc-field-control-gap: var(--substrate-control-gap, 0.5rem);
|
|
26
|
+
--rc-field-label-color: var(--substrate-on-surface-muted, GrayText);
|
|
27
|
+
--rc-field-error-color: var(--substrate-error, red);
|
|
28
|
+
--rc-field-supporting-color: var(--substrate-on-surface-muted, GrayText);
|
|
29
|
+
--rc-field-supporting-font-size: 0.8125rem;
|
|
30
|
+
--rc-field-supporting-padding-block-start: 0.25rem;
|
|
31
|
+
--rc-field-focus-outline: var(--rc-focus-ring, 2px solid Highlight);
|
|
32
|
+
--rc-field-focus-outline-offset: var(--rc-focus-ring-offset, 2px);
|
|
33
|
+
--rc-field-disabled-opacity: var(--rc-disabled-opacity, 0.52);
|
|
34
|
+
font-family: var(--rc-font-family, inherit);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-field::part(field) {
|
|
38
|
+
transition:
|
|
39
|
+
border-color var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease),
|
|
40
|
+
box-shadow var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/*
|
|
44
|
+
* rc-field resets the slotted native control's outline, but a ::slotted()
|
|
45
|
+
* rule loses to any page rule, such as a reset's Firefox :-moz-focusring
|
|
46
|
+
* outline. The field already shows focus, so clear the control's own
|
|
47
|
+
* outline from the light DOM too.
|
|
48
|
+
*/
|
|
49
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate))
|
|
50
|
+
rc-field
|
|
51
|
+
> :is(input, select, textarea):focus-visible {
|
|
52
|
+
outline: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Same hover and focus treatment rc-select, rc-combobox, and rc-textarea use. */
|
|
56
|
+
/* Read-only fields keep focus treatment but skip the hover affordance. */
|
|
57
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate))
|
|
58
|
+
rc-field:not([data-readonly]):hover::part(field) {
|
|
59
|
+
border-color: color-mix(in srgb, var(--rc-accent, Highlight) 55%, var(--rc-border-color));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-field[data-focused]::part(field) {
|
|
63
|
+
box-shadow: 0 0 0 4px color-mix(in srgb, var(--rc-accent, Highlight) 16%, transparent);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-field[data-invalid]::part(label),
|
|
67
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate))
|
|
68
|
+
rc-field[data-group][data-invalid]
|
|
69
|
+
> fieldset
|
|
70
|
+
> legend {
|
|
71
|
+
color: var(--rc-field-error-color, red);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate))
|
|
75
|
+
rc-field[data-invalid]:hover::part(field) {
|
|
76
|
+
border-color: var(--rc-field-error-color, red);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* A textarea grows downward, so its label and control belong at the top. */
|
|
80
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-field[data-multiline]::part(field) {
|
|
81
|
+
align-items: flex-start;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-field[data-multiline]::part(control) {
|
|
85
|
+
align-items: flex-start;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-field > input,
|
|
89
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-field > textarea {
|
|
90
|
+
caret-color: var(--rc-accent, Highlight);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/*
|
|
94
|
+
* Control providers: rc-field's own surface draws the border, background,
|
|
95
|
+
* and focus ring, so the enhancing child has to stop drawing its own or the
|
|
96
|
+
* two sets of chrome nest visibly.
|
|
97
|
+
*/
|
|
98
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate))
|
|
99
|
+
rc-field
|
|
100
|
+
> rc-textarea[data-rc-field-control] {
|
|
101
|
+
--rc-textarea-border: 0;
|
|
102
|
+
--rc-textarea-border-radius: 0;
|
|
103
|
+
--rc-textarea-background: transparent;
|
|
104
|
+
--rc-textarea-padding-block: 0;
|
|
105
|
+
--rc-textarea-padding-inline: 0;
|
|
106
|
+
inline-size: 100%;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate))
|
|
110
|
+
rc-field
|
|
111
|
+
> rc-textarea[data-rc-field-control]::part(root):focus-within {
|
|
112
|
+
box-shadow: none;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate))
|
|
116
|
+
rc-field
|
|
117
|
+
> :is(rc-select, rc-combobox)[data-rc-field-control] {
|
|
118
|
+
--rc-field: transparent;
|
|
119
|
+
inline-size: 100%;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate))
|
|
123
|
+
rc-field
|
|
124
|
+
> rc-select[data-rc-field-control]::part(trigger),
|
|
125
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate))
|
|
126
|
+
rc-field
|
|
127
|
+
> rc-combobox[data-rc-field-control]::part(anchor) {
|
|
128
|
+
min-block-size: 0;
|
|
129
|
+
padding-inline: 0;
|
|
130
|
+
border: 0;
|
|
131
|
+
border-radius: 0;
|
|
132
|
+
background: transparent;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/*
|
|
136
|
+
* Substrate sets the hover and focus chrome on the part directly rather than
|
|
137
|
+
* through a resettable property, so suppressing it needs the same
|
|
138
|
+
* specificity back.
|
|
139
|
+
*/
|
|
140
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate))
|
|
141
|
+
rc-field
|
|
142
|
+
> rc-select[data-rc-field-control]::part(trigger):is(
|
|
143
|
+
:hover,
|
|
144
|
+
:focus-visible,
|
|
145
|
+
[aria-expanded='true']
|
|
146
|
+
),
|
|
147
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate))
|
|
148
|
+
rc-field
|
|
149
|
+
> rc-combobox[data-rc-field-control]::part(anchor):is(:hover, :focus-within) {
|
|
150
|
+
border-color: transparent;
|
|
151
|
+
background: transparent;
|
|
152
|
+
outline: none;
|
|
153
|
+
box-shadow: none;
|
|
154
|
+
}
|
|
155
|
+
}
|
package/components/list-item.css
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
@layer rc-theme-substrate.components {
|
|
2
2
|
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) {
|
|
3
|
+
/* Compatibility tokens retained for rc-listbox and embedded selectors. */
|
|
3
4
|
--rc-list-item-gap: var(--substrate-item-gap, 0.5rem);
|
|
4
5
|
--rc-list-item-min-block-size: 2.25rem;
|
|
5
6
|
--rc-list-item-padding-block: var(--substrate-item-padding-block, 0.55rem);
|
|
6
7
|
--rc-list-item-padding-inline: var(--substrate-item-padding-inline, 0.75rem);
|
|
7
|
-
--rc-list-item-divider: 0;
|
|
8
|
-
--rc-list-item-bg: transparent;
|
|
9
|
-
--rc-list-item-color: var(--rc-field-text, FieldText);
|
|
10
|
-
--rc-list-item-supporting-color: var(--substrate-on-surface-muted, GrayText);
|
|
11
8
|
--rc-list-item-hover-bg: color-mix(in srgb, var(--rc-accent, Highlight) 10%, transparent);
|
|
12
9
|
--rc-list-item-active-bg: color-mix(in srgb, var(--rc-accent, Highlight) 16%, transparent);
|
|
13
10
|
--rc-list-item-selected-bg: var(--rc-highlight, Highlight);
|
|
@@ -15,41 +12,47 @@
|
|
|
15
12
|
--rc-list-item-disabled-opacity: var(--rc-disabled-opacity, 0.52);
|
|
16
13
|
}
|
|
17
14
|
|
|
18
|
-
:where(.rc-theme-substrate, :host(.rc-theme-substrate))
|
|
19
|
-
list-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
15
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-list {
|
|
16
|
+
--rc-list-padding-inline: var(--substrate-item-padding-inline, 0.75rem);
|
|
17
|
+
--rc-list-leading-gap: var(--substrate-item-gap, 0.5rem);
|
|
18
|
+
--rc-list-trailing-gap: var(--substrate-item-gap, 0.5rem);
|
|
19
|
+
--rc-list-row-gap: 0;
|
|
20
|
+
--rc-list-item-min-block-size: 2.25rem;
|
|
21
|
+
--rc-list-item-padding-block: var(--substrate-item-padding-block, 0.55rem);
|
|
22
|
+
--rc-list-item-color: var(--rc-field-text, FieldText);
|
|
23
|
+
--rc-list-item-background: transparent;
|
|
24
|
+
--rc-list-item-selected-color: var(--rc-highlight-text, HighlightText);
|
|
25
|
+
--rc-list-item-selected-background: var(--rc-highlight, Highlight);
|
|
26
|
+
--rc-list-item-divider: 1px solid var(--substrate-border-color, GrayText);
|
|
27
|
+
--rc-list-item-state-layer-color: var(--rc-accent, Highlight);
|
|
28
|
+
--rc-list-item-hover-state-layer-opacity: 0.1;
|
|
29
|
+
--rc-list-item-focus-state-layer-opacity: 0.12;
|
|
30
|
+
--rc-list-item-pressed-state-layer-opacity: 0.16;
|
|
31
|
+
--rc-list-item-disabled-opacity: var(--rc-disabled-opacity, 0.52);
|
|
32
|
+
--rc-list-item-transition-duration: var(--rc-motion-effects-duration-fast, 100ms);
|
|
34
33
|
}
|
|
35
34
|
|
|
36
|
-
:where(.rc-theme-substrate, :host(.rc-theme-substrate))
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-list[variant='segmented'] {
|
|
36
|
+
--rc-list-padding-inline: 0;
|
|
37
|
+
--rc-list-row-gap: 0.25rem;
|
|
38
|
+
--rc-list-item-background: var(--substrate-surface-raised, Field);
|
|
39
|
+
--rc-list-item-divider: 0;
|
|
40
|
+
--rc-list-item-border: 1px solid var(--substrate-border-color, GrayText);
|
|
41
|
+
--rc-list-item-border-radius: var(--substrate-radius-md, 0.375rem);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
:where(.rc-theme-substrate, :host(.rc-theme-substrate))
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate))
|
|
45
|
+
rc-list-item
|
|
46
|
+
> :where([data-rc-list-supporting], small) {
|
|
47
|
+
display: block;
|
|
48
|
+
color: var(--substrate-on-surface-muted, GrayText);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
:where(.rc-theme-substrate, :host(.rc-theme-substrate))
|
|
52
|
-
|
|
51
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate))
|
|
52
|
+
rc-list-item
|
|
53
|
+
> :is(input[type='checkbox'], input[type='radio'])[slot='leading'] {
|
|
54
|
+
margin: 0;
|
|
55
|
+
accent-color: var(--rc-accent, Highlight);
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-listbox,
|
package/components/listbox.css
CHANGED
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
--rc-listbox-option-padding-block: var(--substrate-item-padding-block, 0.55rem);
|
|
6
6
|
--rc-listbox-option-padding-inline: var(--substrate-item-padding-inline, 0.75rem);
|
|
7
7
|
--rc-listbox-option-transition:
|
|
8
|
-
background-color var(--substrate-motion-duration, 160ms)
|
|
9
|
-
|
|
8
|
+
background-color var(--substrate-motion-effects-duration-default, 160ms)
|
|
9
|
+
var(--substrate-motion-easing, ease),
|
|
10
|
+
color var(--substrate-motion-effects-duration-default, 160ms)
|
|
11
|
+
var(--substrate-motion-easing, ease);
|
|
10
12
|
--rc-listbox-hover-bg: color-mix(in srgb, var(--rc-accent, Highlight) 10%, transparent);
|
|
11
13
|
--rc-listbox-hover-color: var(--rc-field-text, FieldText);
|
|
12
14
|
--rc-listbox-active-bg: color-mix(in srgb, var(--rc-accent, Highlight) 16%, transparent);
|
|
@@ -1,37 +1,50 @@
|
|
|
1
1
|
@layer rc-theme-substrate.components {
|
|
2
2
|
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-markdown-editor {
|
|
3
|
-
--
|
|
4
|
-
--
|
|
5
|
-
--
|
|
6
|
-
|
|
7
|
-
--
|
|
8
|
-
--
|
|
9
|
-
--
|
|
10
|
-
--
|
|
11
|
-
--
|
|
12
|
-
--
|
|
13
|
-
--
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
--
|
|
17
|
-
--
|
|
18
|
-
--
|
|
19
|
-
--
|
|
20
|
-
--
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
--
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
--
|
|
29
|
-
--
|
|
30
|
-
--
|
|
31
|
-
--
|
|
32
|
-
--
|
|
33
|
-
--
|
|
34
|
-
--
|
|
3
|
+
--rc-markdown-editor-padding: 0.75rem;
|
|
4
|
+
--rc-markdown-editor-border: var(--rc-border, 1px solid ButtonBorder);
|
|
5
|
+
--rc-markdown-editor-border-radius: 0 0 var(--substrate-radius-lg, 0.75rem)
|
|
6
|
+
var(--substrate-radius-lg, 0.75rem);
|
|
7
|
+
--rc-markdown-editor-background: var(--rc-field, Field);
|
|
8
|
+
--rc-markdown-editor-color: var(--rc-field-text, FieldText);
|
|
9
|
+
--rc-markdown-editor-toolbar-background: var(--substrate-surface-raised, Canvas);
|
|
10
|
+
--rc-markdown-editor-toolbar-color: var(--substrate-on-surface, CanvasText);
|
|
11
|
+
--rc-markdown-editor-toolbar-border: var(--rc-border, 1px solid ButtonBorder);
|
|
12
|
+
--rc-markdown-editor-toolbar-gap: 0.125rem;
|
|
13
|
+
--rc-markdown-editor-toolbar-padding: 0.25rem;
|
|
14
|
+
--rc-markdown-editor-toolbar-radius: var(--substrate-radius-lg, 0.75rem)
|
|
15
|
+
var(--substrate-radius-lg, 0.75rem) 0 0;
|
|
16
|
+
--rc-markdown-editor-toolbar-button-size: var(--rc-control-block-size, 2.5rem);
|
|
17
|
+
--rc-markdown-editor-toolbar-button-color: var(--substrate-on-surface, ButtonText);
|
|
18
|
+
--rc-markdown-editor-toolbar-button-border: 1px solid transparent;
|
|
19
|
+
--rc-markdown-editor-toolbar-button-radius: var(--substrate-radius-md, 0.5rem);
|
|
20
|
+
--rc-markdown-editor-toolbar-button-active-background: var(
|
|
21
|
+
--substrate-primary-container,
|
|
22
|
+
Highlight
|
|
23
|
+
);
|
|
24
|
+
--rc-markdown-editor-toolbar-button-active-color: var(
|
|
25
|
+
--substrate-on-primary-container,
|
|
26
|
+
HighlightText
|
|
27
|
+
);
|
|
28
|
+
--rc-markdown-editor-toolbar-button-active-border: 1px solid var(--substrate-primary, Highlight);
|
|
29
|
+
--rc-markdown-editor-toolbar-focus-outline: var(--rc-focus-ring, 2px solid Highlight);
|
|
30
|
+
--rc-markdown-editor-toolbar-focus-outline-offset: var(--rc-focus-ring-offset, 2px);
|
|
31
|
+
--rc-markdown-editor-toolbar-select-background: var(--substrate-field, Field);
|
|
32
|
+
--rc-markdown-editor-toolbar-select-color: var(--substrate-on-surface, FieldText);
|
|
33
|
+
--rc-markdown-editor-toolbar-select-border: var(--rc-border, 1px solid ButtonBorder);
|
|
34
|
+
--rc-markdown-editor-toolbar-select-radius: var(--substrate-radius-sm, 0.25rem);
|
|
35
|
+
--rc-markdown-editor-toolbar-select-active-background: var(
|
|
36
|
+
--substrate-primary-container,
|
|
37
|
+
Highlight
|
|
38
|
+
);
|
|
39
|
+
--rc-markdown-editor-toolbar-select-active-color: var(
|
|
40
|
+
--substrate-on-primary-container,
|
|
41
|
+
HighlightText
|
|
42
|
+
);
|
|
43
|
+
--rc-markdown-editor-toolbar-select-active-border-color: var(--substrate-primary, Highlight);
|
|
44
|
+
--rc-markdown-editor-toolbar-input-background: var(--substrate-field, Field);
|
|
45
|
+
--rc-markdown-editor-toolbar-input-color: var(--substrate-on-surface, FieldText);
|
|
46
|
+
--rc-markdown-editor-toolbar-input-border: var(--rc-border, 1px solid ButtonBorder);
|
|
47
|
+
--rc-markdown-editor-toolbar-input-radius: var(--substrate-radius-sm, 0.25rem);
|
|
35
48
|
}
|
|
36
49
|
|
|
37
50
|
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-markdown-editor::part(rich-view) {
|
package/components/menu.css
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
@layer rc-theme-substrate.components {
|
|
2
|
-
|
|
2
|
+
/*
|
|
3
|
+
* Declared on the theme root rather than on rc-menu so menus rendered
|
|
4
|
+
* inside other shadow roots inherit the same values.
|
|
5
|
+
*/
|
|
6
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) {
|
|
3
7
|
--rc-menu-item-gap: var(--substrate-item-gap, 0.5rem);
|
|
4
8
|
--rc-menu-item-min-block-size: 2.25rem;
|
|
5
9
|
--rc-menu-item-padding-block: var(--substrate-item-padding-block, 0.55rem);
|
|
@@ -7,12 +11,13 @@
|
|
|
7
11
|
--rc-menu-hover-bg: color-mix(in srgb, var(--rc-accent, Highlight) 10%, transparent);
|
|
8
12
|
--rc-menu-active-bg: color-mix(in srgb, var(--rc-accent, Highlight) 16%, transparent);
|
|
9
13
|
--rc-menu-check-size: 1.25rem;
|
|
14
|
+
--rc-menu-background: var(--substrate-surface-raised, Canvas);
|
|
15
|
+
--rc-menu-shadow: var(--rc-shadow, none);
|
|
16
|
+
--rc-menu-padding-block: 0.25rem;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-menu {
|
|
10
20
|
display: inline-block;
|
|
11
|
-
border: var(--rc-border, 1px solid ButtonBorder);
|
|
12
|
-
border-radius: var(--substrate-radius-lg, 0.75rem);
|
|
13
|
-
background: var(--substrate-surface-raised, Canvas);
|
|
14
|
-
box-shadow: var(--rc-shadow, none);
|
|
15
|
-
padding-block: 0.25rem;
|
|
16
21
|
}
|
|
17
22
|
|
|
18
23
|
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-menu [data-group-label] {
|
package/components/modes.css
CHANGED
|
@@ -21,4 +21,40 @@
|
|
|
21
21
|
view-transition-name: var(--rc-view-transition-name, none);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
/*
|
|
26
|
+
* The vestibular harm reduced motion guards against is movement across the
|
|
27
|
+
* visual field, which a color or opacity change does not trigger; removing
|
|
28
|
+
* every transition over-corrected. Spatial motion still goes fully to
|
|
29
|
+
* zero. Effects motion is kept but shortened, scaled down from
|
|
30
|
+
* Substrate's own already-quick 100/160/240ms scale. The two legacy
|
|
31
|
+
* primitives (--substrate-motion-duration and its -slow companion,
|
|
32
|
+
* predating the effects/spatial split) and the cross-theme compatibility
|
|
33
|
+
* token stay at zero: dialog.css is their one remaining direct consumer,
|
|
34
|
+
* animating opacity, display, and transform together in one declaration
|
|
35
|
+
* that mixes spatial and effects properties and can't be cleanly
|
|
36
|
+
* classified into one bucket. (That file's own transform-based entrance
|
|
37
|
+
* is a separate, pre-existing conflict with rc-dialog's pointer-resize
|
|
38
|
+
* geometry reads and remains outside this theme-level override.)
|
|
39
|
+
*/
|
|
40
|
+
@media (prefers-reduced-motion: reduce) {
|
|
41
|
+
.rc-theme-substrate,
|
|
42
|
+
:host(.rc-theme-substrate) {
|
|
43
|
+
--substrate-motion-duration: 0ms;
|
|
44
|
+
--substrate-motion-duration-slow: 0ms;
|
|
45
|
+
--substrate-motion-effects-duration-fast: 40ms;
|
|
46
|
+
--substrate-motion-effects-duration-default: 55ms;
|
|
47
|
+
--substrate-motion-effects-duration-slow: 70ms;
|
|
48
|
+
--substrate-motion-spatial-duration-fast: 0ms;
|
|
49
|
+
--substrate-motion-spatial-duration-default: 0ms;
|
|
50
|
+
--substrate-motion-spatial-duration-slow: 0ms;
|
|
51
|
+
--rc-motion-duration: 0ms;
|
|
52
|
+
--rc-motion-effects-duration-fast: 40ms;
|
|
53
|
+
--rc-motion-effects-duration-default: 55ms;
|
|
54
|
+
--rc-motion-effects-duration-slow: 70ms;
|
|
55
|
+
--rc-motion-spatial-duration-fast: 0ms;
|
|
56
|
+
--rc-motion-spatial-duration-default: 0ms;
|
|
57
|
+
--rc-motion-spatial-duration-slow: 0ms;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
24
60
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@layer rc-theme-substrate.components {
|
|
2
|
+
/*
|
|
3
|
+
* The border, corner, and elevation come from the bridge's --rc-popup-*
|
|
4
|
+
* tokens. A popover sits on the raised surface like a menu, with item-scale
|
|
5
|
+
* padding. Declared on the theme root so popovers rendered inside other
|
|
6
|
+
* shadow roots inherit the same values.
|
|
7
|
+
*/
|
|
8
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) {
|
|
9
|
+
--rc-popover-background: var(--substrate-surface-raised, Canvas);
|
|
10
|
+
--rc-popover-padding-block: var(--substrate-item-padding-block, 0.55rem);
|
|
11
|
+
--rc-popover-padding-inline: var(--substrate-item-padding-inline, 0.75rem);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@layer rc-theme-substrate.components {
|
|
2
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-progress::part(value-display) {
|
|
3
|
+
color: var(--substrate-on-surface-muted, GrayText);
|
|
4
|
+
font-variant-numeric: tabular-nums;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-progress {
|
|
8
|
+
--rc-progress-fill-transition-duration: var(--rc-motion-effects-duration-fast, 100ms);
|
|
9
|
+
--rc-progress-fill-transition-easing: var(--rc-motion-effects-easing-fast, ease-out);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@layer rc-theme-substrate.components {
|
|
2
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-scroller {
|
|
3
|
+
/*
|
|
4
|
+
* Capped a little narrower than Material's 1200px: Substrate runs a smaller
|
|
5
|
+
* base font, so the same pixel width carries more characters per line.
|
|
6
|
+
*/
|
|
7
|
+
--rc-scroller-content-max-inline-size: 68rem;
|
|
8
|
+
--rc-scroller-content-padding-inline: var(--substrate-item-padding-inline, 0.75rem);
|
|
9
|
+
--rc-scroller-content-row-gap: var(--substrate-item-gap, 0.5rem);
|
|
10
|
+
|
|
11
|
+
--rc-scroller-scrollbar-width: thin;
|
|
12
|
+
--rc-scroller-scrollbar-color: color-mix(
|
|
13
|
+
in srgb,
|
|
14
|
+
var(--substrate-on-surface-muted, GrayText) 45%,
|
|
15
|
+
transparent
|
|
16
|
+
)
|
|
17
|
+
transparent;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -22,7 +22,9 @@
|
|
|
22
22
|
outline-offset: var(--rc-focus-ring-offset, 2px);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
:where(.rc-theme-substrate, :host(.rc-theme-substrate))
|
|
25
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate))
|
|
26
|
+
rc-search-bar
|
|
27
|
+
> input[type='search']:focus-visible {
|
|
26
28
|
outline: none;
|
|
27
29
|
}
|
|
28
30
|
}
|
|
@@ -1,32 +1,7 @@
|
|
|
1
1
|
@layer rc-theme-substrate.components {
|
|
2
2
|
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-segmented-button {
|
|
3
|
-
|
|
4
|
-
--
|
|
5
|
-
--_rc-segmented-button-fieldset-padding: 0;
|
|
6
|
-
--_rc-segmented-button-fieldset-border: 0;
|
|
7
|
-
--_rc-segmented-button-fieldset-radius: 0;
|
|
8
|
-
--_rc-segmented-button-fieldset-overflow: visible;
|
|
9
|
-
--_rc-segmented-button-legend-position: absolute;
|
|
10
|
-
--_rc-segmented-button-legend-inline-size: 1px;
|
|
11
|
-
--_rc-segmented-button-legend-block-size: 1px;
|
|
12
|
-
--_rc-segmented-button-legend-margin: -1px;
|
|
13
|
-
--_rc-segmented-button-legend-padding: 0;
|
|
14
|
-
--_rc-segmented-button-legend-border: 0;
|
|
15
|
-
--_rc-segmented-button-legend-overflow: hidden;
|
|
16
|
-
--_rc-segmented-button-legend-clip: rect(0 0 0 0);
|
|
17
|
-
--_rc-segmented-button-legend-white-space: nowrap;
|
|
18
|
-
--_rc-segmented-button-segment-display: inline-flex;
|
|
19
|
-
--_rc-segmented-button-segment-cursor: pointer;
|
|
20
|
-
--_rc-segmented-button-segment-user-select: none;
|
|
21
|
-
--_rc-segmented-button-disabled-cursor: not-allowed;
|
|
22
|
-
--_rc-segmented-button-radio-position: absolute;
|
|
23
|
-
--_rc-segmented-button-radio-inline-size: 1px;
|
|
24
|
-
--_rc-segmented-button-radio-block-size: 1px;
|
|
25
|
-
--_rc-segmented-button-radio-margin: 0;
|
|
26
|
-
--_rc-segmented-button-radio-opacity: 0;
|
|
27
|
-
--_rc-segmented-button-radio-pointer-events: none;
|
|
28
|
-
--_rc-segmented-button-selected-icon-display: inline-grid;
|
|
29
|
-
--_rc-segmented-button-vertical-border-inline-start: var(--rc-border);
|
|
3
|
+
/* One switch turns on the component-owned segmented recipe. */
|
|
4
|
+
--rc-segmented-button-appearance: segmented;
|
|
30
5
|
--rc-segmented-button-border: var(--rc-border);
|
|
31
6
|
--rc-segmented-button-radius: var(--rc-control-radius);
|
|
32
7
|
--rc-segmented-button-divider: 0;
|
package/components/select.css
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
@layer rc-theme-substrate.components {
|
|
2
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate))
|
|
3
|
+
:is(rc-select, rc-combobox)[popup-mode='dialog']::part(dialog) {
|
|
4
|
+
position: fixed;
|
|
5
|
+
inset: auto;
|
|
6
|
+
top: var(--rc-dialog-visual-viewport-top, 0);
|
|
7
|
+
left: var(--rc-dialog-visual-viewport-left, 0);
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
inline-size: var(--rc-dialog-visual-viewport-width, 100dvw);
|
|
10
|
+
block-size: var(--rc-dialog-visual-viewport-height, 100dvh);
|
|
11
|
+
max-inline-size: none;
|
|
12
|
+
max-block-size: none;
|
|
13
|
+
margin: 0;
|
|
14
|
+
padding-block: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-bottom));
|
|
15
|
+
padding-inline: max(1rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-right));
|
|
16
|
+
resize: none;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
border-radius: 0;
|
|
19
|
+
box-shadow: none;
|
|
20
|
+
transform: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
2
23
|
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-select {
|
|
3
24
|
display: inline-block;
|
|
4
25
|
}
|
package/components/splitter.css
CHANGED
|
@@ -1,14 +1,39 @@
|
|
|
1
1
|
@layer rc-theme-substrate.components {
|
|
2
|
+
/*
|
|
3
|
+
* Geometry is deliberately left to the component's own defaults here; this
|
|
4
|
+
* theme only paints the splitter. See the matching assertion in
|
|
5
|
+
* components.test.ts.
|
|
6
|
+
*/
|
|
2
7
|
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-splitter {
|
|
8
|
+
/*
|
|
9
|
+
* Both of these used to mix against the bare `Canvas` and `ButtonBorder`
|
|
10
|
+
* system colors, which have no value outside a browser and so could not
|
|
11
|
+
* reach the token export at all. Mixing against the theme's own surface and
|
|
12
|
+
* border keeps the intent and makes the result a real color.
|
|
13
|
+
*/
|
|
3
14
|
--rc-splitter-separator-color: color-mix(
|
|
4
15
|
in srgb,
|
|
5
16
|
var(--rc-accent, Highlight) 8%,
|
|
6
|
-
Canvas
|
|
17
|
+
var(--substrate-surface, Canvas)
|
|
7
18
|
);
|
|
8
19
|
--rc-splitter-handle-color: color-mix(
|
|
9
20
|
in srgb,
|
|
10
21
|
var(--rc-accent, Highlight) 45%,
|
|
11
|
-
ButtonBorder
|
|
22
|
+
var(--substrate-border-color, ButtonBorder)
|
|
12
23
|
);
|
|
24
|
+
|
|
25
|
+
--rc-splitter-handle-fill: var(--substrate-border-color, ButtonBorder);
|
|
26
|
+
--rc-splitter-handle-hover-fill: var(--rc-accent, Highlight);
|
|
27
|
+
--rc-splitter-handle-transition: var(--substrate-motion-effects-duration-default, 160ms);
|
|
28
|
+
--rc-splitter-keyline: var(--rc-border, 1px solid ButtonBorder);
|
|
29
|
+
|
|
30
|
+
--rc-splitter-collapse-button-bg: var(--substrate-surface-raised, ButtonFace);
|
|
31
|
+
--rc-splitter-collapse-button-hover-bg: color-mix(
|
|
32
|
+
in srgb,
|
|
33
|
+
var(--rc-accent, Highlight) 10%,
|
|
34
|
+
var(--substrate-surface-raised, ButtonFace)
|
|
35
|
+
);
|
|
36
|
+
--rc-splitter-collapse-button-border: var(--rc-border, 1px solid ButtonBorder);
|
|
37
|
+
--rc-splitter-collapse-button-color: var(--substrate-on-surface, ButtonText);
|
|
13
38
|
}
|
|
14
39
|
}
|
package/components/textarea.css
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
@layer rc-theme-substrate.components {
|
|
2
2
|
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-textarea {
|
|
3
|
-
--rc-textarea-padding: 0.75rem;
|
|
3
|
+
--rc-textarea-padding-block: 0.75rem;
|
|
4
|
+
--rc-textarea-padding-inline: 0.75rem;
|
|
4
5
|
--rc-textarea-border: var(--rc-border, 1px solid ButtonBorder);
|
|
5
|
-
--rc-textarea-radius: var(--substrate-radius-lg, 0.75rem);
|
|
6
|
+
--rc-textarea-border-radius: var(--substrate-radius-lg, 0.75rem);
|
|
6
7
|
--rc-textarea-background: var(--rc-field, Field);
|
|
7
8
|
--rc-textarea-color: var(--rc-field-text, FieldText);
|
|
8
9
|
font-family: var(--rc-font-family, inherit);
|
package/components/toolbar.css
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
@layer rc-theme-substrate.components {
|
|
2
2
|
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-toolbar {
|
|
3
3
|
display: inline-block;
|
|
4
|
+
|
|
5
|
+
--rc-toolbar-gap-inline: 0.125rem;
|
|
6
|
+
--rc-toolbar-padding-block: 0.25rem;
|
|
7
|
+
--rc-toolbar-padding-inline: 0.25rem;
|
|
8
|
+
--rc-toolbar-radius: var(--substrate-radius-md, 0.5rem);
|
|
9
|
+
--rc-toolbar-vertical-radius: var(--substrate-radius-md, 0.5rem);
|
|
10
|
+
--rc-toolbar-flex-wrap: nowrap;
|
|
4
11
|
}
|
|
5
12
|
|
|
6
13
|
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-toolbar::part(root) {
|
|
7
|
-
gap: 0.125rem;
|
|
14
|
+
gap: var(--rc-toolbar-gap-inline, 0.125rem);
|
|
8
15
|
}
|
|
9
16
|
|
|
10
17
|
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-toolbar > button {
|
|
@@ -22,9 +29,7 @@
|
|
|
22
29
|
background: color-mix(in srgb, var(--rc-accent, Highlight) 10%, transparent);
|
|
23
30
|
}
|
|
24
31
|
|
|
25
|
-
:where(.rc-theme-substrate, :host(.rc-theme-substrate))
|
|
26
|
-
rc-toolbar
|
|
27
|
-
> button[aria-pressed='true'] {
|
|
32
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-toolbar > button[aria-pressed='true'] {
|
|
28
33
|
background: var(--rc-highlight, Highlight);
|
|
29
34
|
color: var(--rc-highlight-text, HighlightText);
|
|
30
35
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@layer rc-theme-substrate.components {
|
|
2
|
+
/*
|
|
3
|
+
* Tooltips use the inverse surface, like snackbars. Declared on the theme
|
|
4
|
+
* root so tooltips inside other shadow roots inherit the same values.
|
|
5
|
+
*/
|
|
6
|
+
:where(.rc-theme-substrate, :host(.rc-theme-substrate)) {
|
|
7
|
+
--rc-tooltip-padding-block: 0.375rem;
|
|
8
|
+
--rc-tooltip-padding-inline: 0.625rem;
|
|
9
|
+
--rc-tooltip-border: 0;
|
|
10
|
+
--rc-tooltip-radius: var(--substrate-radius-sm, 0.25rem);
|
|
11
|
+
--rc-tooltip-background: var(--substrate-inverse-surface, CanvasText);
|
|
12
|
+
--rc-tooltip-color: var(--substrate-inverse-on-surface, Canvas);
|
|
13
|
+
--rc-tooltip-shadow: var(--substrate-shadow-sm, none);
|
|
14
|
+
}
|
|
15
|
+
}
|