@rcarls/rc-theme-substrate 0.6.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +394 -0
  2. package/README.md +23 -0
  3. package/bridge.css +38 -17
  4. package/components/accordion.css +10 -113
  5. package/components/adaptive-menu.css +98 -0
  6. package/components/app-bar.css +1 -1
  7. package/components/bottom-sheet.css +1 -1
  8. package/components/carousel.css +31 -0
  9. package/components/chip-group.css +21 -0
  10. package/components/dialog.css +15 -11
  11. package/components/disclosure.css +62 -68
  12. package/components/fab-menu.css +3 -3
  13. package/components/field.css +155 -0
  14. package/components/list-item.css +4 -6
  15. package/components/listbox.css +4 -2
  16. package/components/markdown-editor.css +45 -32
  17. package/components/menu.css +11 -6
  18. package/components/modes.css +36 -0
  19. package/components/popover.css +13 -0
  20. package/components/progress.css +5 -0
  21. package/components/scroller.css +19 -0
  22. package/components/segmented-button.css +2 -27
  23. package/components/select.css +21 -0
  24. package/components/splitter.css +35 -2
  25. package/components/textarea.css +3 -2
  26. package/components/toolbar.css +8 -1
  27. package/components/tooltip.css +15 -0
  28. package/components/transfer-list.css +3 -3
  29. package/components/virtual-canvas.css +10 -0
  30. package/components/virtual-scroller.css +7 -0
  31. package/components.css +10 -1
  32. package/css-components/button.css +66 -0
  33. package/css-components/card.css +14 -0
  34. package/css-components/chip-group.css +9 -0
  35. package/css-components/chip.css +80 -0
  36. package/css-components/disclosure.css +25 -0
  37. package/css-components/list.css +34 -0
  38. package/css-components/select.css +20 -0
  39. package/css-components/textarea.css +22 -0
  40. package/css-components.css +31 -0
  41. package/defaults.css +30 -1
  42. package/native.css +249 -0
  43. package/package.json +5 -1
@@ -0,0 +1,98 @@
1
+ @layer rc-theme-substrate.components {
2
+ /*
3
+ * Declared on the theme root rather than on rc-adaptive-menu so menus
4
+ * rendered inside other shadow roots inherit the same values.
5
+ */
6
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) {
7
+ --rc-adaptive-menu-gap: var(--substrate-control-gap, 0.5rem);
8
+ --rc-adaptive-menu-icon-size: 1.25rem;
9
+
10
+ --rc-adaptive-menu-trigger-background: transparent;
11
+ --rc-adaptive-menu-trigger-border: 0;
12
+ --rc-adaptive-menu-trigger-color: var(--substrate-on-surface-muted, ButtonText);
13
+ --rc-adaptive-menu-trigger-block-size: 2.25rem;
14
+ --rc-adaptive-menu-trigger-inline-size: 2.25rem;
15
+ --rc-adaptive-menu-trigger-padding: 0.375rem;
16
+ --rc-adaptive-menu-trigger-radius: var(--substrate-radius-md, 0.5rem);
17
+ --rc-adaptive-menu-trigger-hover-background: color-mix(
18
+ in srgb,
19
+ var(--rc-accent, Highlight) 10%,
20
+ var(--substrate-surface, Canvas)
21
+ );
22
+
23
+ /*
24
+ * The trigger is drawn at 2.25rem for density, so the hit area is inflated
25
+ * separately to clear the 3rem touch minimum without widening the row.
26
+ */
27
+ --rc-adaptive-menu-touch-target-block-size: 3rem;
28
+ --rc-adaptive-menu-touch-target-inline-size: 3rem;
29
+ --rc-adaptive-menu-touch-target-overlap-inline-end: 0.375rem;
30
+
31
+ --rc-adaptive-menu-popup-min-inline-size: 12rem;
32
+
33
+ /*
34
+ * The sheet presentation exists because a finger is doing the pointing, so
35
+ * its rows take the larger list item height rather than the menu row height.
36
+ */
37
+ --rc-adaptive-menu-item-min-block-size: 3rem;
38
+ --rc-adaptive-menu-item-padding-block: var(--substrate-item-padding-block, 0.55rem);
39
+ --rc-adaptive-menu-item-padding-inline: var(--substrate-item-padding-inline, 0.75rem);
40
+ --rc-adaptive-menu-item-gap: var(--substrate-item-gap, 0.5rem);
41
+ }
42
+ }
43
+
44
+ /*
45
+ * An action rc-adaptive-menu moves into its overflow renders as a menu row.
46
+ * rc-adaptive-menu maps the action's own tokens onto its item tokens in rc-base,
47
+ * which sits below every theme layer, so this layer repeats the mapping above the
48
+ * theme's button and menu-button variants (filled, tonal, icon-only sizes, and so
49
+ * on) that would otherwise restyle the row as a standalone control.
50
+ */
51
+ @layer rc-theme-substrate.overrides {
52
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
53
+ rc-adaptive-menu
54
+ > rc-button[data-rc-action-overflowed] {
55
+ --rc-button-block-size: var(--rc-adaptive-menu-item-min-block-size, 2.5em);
56
+ --rc-button-icon-size: 100%;
57
+ --rc-button-touch-target-inline-size: 100%;
58
+ --rc-button-touch-target-block-size: var(--rc-adaptive-menu-item-min-block-size, 2.5em);
59
+ --rc-button-padding-inline: var(
60
+ --rc-adaptive-menu-item-padding-inline,
61
+ var(--rc-item-padding-inline, 0.75em)
62
+ );
63
+ --rc-button-padding-block: var(
64
+ --rc-adaptive-menu-item-padding-block,
65
+ var(--rc-item-padding-block, 0.3em)
66
+ );
67
+ --rc-button-radius: 0;
68
+ --rc-button-bg: transparent;
69
+ --rc-button-color: currentColor;
70
+ --rc-button-border: 0;
71
+ --rc-button-state-layer-bg: currentColor;
72
+ --rc-button-progress-color: currentColor;
73
+ }
74
+
75
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
76
+ rc-adaptive-menu
77
+ > rc-menu-button[data-rc-action-overflowed] {
78
+ --rc-menu-button-trigger-block-size: var(--rc-adaptive-menu-item-min-block-size, 2.5em);
79
+ --rc-menu-button-icon-size: 100%;
80
+ --rc-menu-button-touch-target-inline-size: 100%;
81
+ --rc-menu-button-touch-target-block-size: var(--rc-adaptive-menu-item-min-block-size, 2.5em);
82
+ --rc-menu-button-trigger-padding-block: var(
83
+ --rc-adaptive-menu-item-padding-block,
84
+ var(--rc-item-padding-block, 0.3em)
85
+ );
86
+ --rc-menu-button-trigger-padding-inline: var(
87
+ --rc-adaptive-menu-item-padding-inline,
88
+ var(--rc-item-padding-inline, 0.75em)
89
+ );
90
+ --rc-menu-button-trigger-gap: var(--rc-adaptive-menu-item-gap, var(--rc-item-gap, 0.5em));
91
+ --rc-menu-button-trigger-radius: 0;
92
+ --rc-menu-button-trigger-border: 0;
93
+ --rc-menu-button-trigger-background: transparent;
94
+ --rc-menu-button-trigger-color: currentColor;
95
+ --rc-menu-button-trigger-hover-color: currentColor;
96
+ --rc-menu-button-trigger-open-color: currentColor;
97
+ }
98
+ }
@@ -1,6 +1,6 @@
1
1
  @layer rc-theme-substrate.components {
2
2
  :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-app-bar {
3
- --rc-app-bar-background: color-mix(in srgb, var(--substrate-surface, Canvas) 88%, transparent);
3
+ --rc-app-bar-bg: color-mix(in srgb, var(--substrate-surface, Canvas) 88%, transparent);
4
4
  --rc-app-bar-color: var(--rc-field-text, CanvasText);
5
5
  --rc-app-bar-scroll-divider: var(--rc-border, 1px solid ButtonBorder);
6
6
  --rc-app-bar-shadow: none;
@@ -55,7 +55,7 @@
55
55
  [data-rc-bottom-sheet-handle]::before {
56
56
  content: '';
57
57
  position: absolute;
58
- inset-block-start: 50%;
58
+ inset-block-start: var(--rc-bottom-sheet-handle-offset, 50%);
59
59
  inset-inline-start: 50%;
60
60
  inline-size: var(--rc-bottom-sheet-handle-inline-size, 2rem);
61
61
  block-size: var(--rc-bottom-sheet-handle-block-size, 0.25rem);
@@ -0,0 +1,31 @@
1
+ @layer rc-theme-substrate.components {
2
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-carousel {
3
+ --rc-carousel-color: var(--substrate-on-surface, CanvasText);
4
+ --rc-carousel-gap: var(--substrate-control-gap, 0.5rem);
5
+
6
+ /*
7
+ * A slide is a raised card on the page surface, which is what separates it
8
+ * from the track behind it without needing a border.
9
+ */
10
+ --rc-carousel-item-background: var(--substrate-surface-raised, Canvas);
11
+ --rc-carousel-item-color: var(--substrate-on-surface, CanvasText);
12
+ --rc-carousel-item-border-radius: var(--substrate-radius-lg, 0.75rem);
13
+
14
+ --rc-carousel-navigation-button-background: color-mix(
15
+ in srgb,
16
+ var(--substrate-surface, Canvas) 88%,
17
+ transparent
18
+ );
19
+ --rc-carousel-navigation-button-color: var(--substrate-on-surface, CanvasText);
20
+ --rc-carousel-navigation-button-size: 2.25rem;
21
+ --rc-carousel-navigation-inset: 0.5rem;
22
+
23
+ --rc-carousel-pagination-item-active-color: var(--rc-accent, Highlight);
24
+ --rc-carousel-pagination-item-color: color-mix(
25
+ in srgb,
26
+ var(--substrate-on-surface-muted, GrayText) 40%,
27
+ transparent
28
+ );
29
+ --rc-carousel-pagination-item-size: 0.5rem;
30
+ }
31
+ }
@@ -0,0 +1,21 @@
1
+ @layer rc-theme-substrate.components {
2
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-chip-group {
3
+ --rc-chip-group-column-gap: var(--substrate-control-gap, 0.5rem);
4
+ --rc-chip-group-row-gap: var(--substrate-control-gap, 0.5rem);
5
+ --rc-chip-group-padding-block: 0.25rem;
6
+
7
+ /*
8
+ * A scrolling group is padded on the inline axis so a chip snapped to the
9
+ * start does not sit flush against the edge it scrolled from.
10
+ */
11
+ --rc-chip-group-scroll-padding-inline: var(--substrate-item-padding-inline, 0.75rem);
12
+ --rc-chip-group-scrollbar-width: none;
13
+
14
+ --rc-chip-group-toggle-gap: var(--substrate-control-gap, 0.5rem);
15
+ --rc-chip-group-toggle-icon-size: 1.125rem;
16
+ --rc-chip-group-toggle-separator-color: var(--substrate-border-color, ButtonBorder);
17
+ --rc-chip-group-toggle-separator-block-size: 1.5rem;
18
+ --rc-chip-group-toggle-separator-inline-size: 1px;
19
+ --rc-chip-group-toggle-separator-gap: var(--substrate-control-gap, 0.5rem);
20
+ }
21
+ }
@@ -1,22 +1,28 @@
1
1
  @layer rc-theme-substrate.components {
2
+ /*
3
+ * Maps Substrate tokens onto the public rc-dialog properties. The surface and
4
+ * the fullscreen geometry are drawn by the component's own light-DOM base
5
+ * layer; what is left here is the mapping plus the open and close motion,
6
+ * which depends on state selectors a bounded property cannot express.
7
+ */
8
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-dialog {
9
+ --rc-dialog-border: var(--rc-border, 1px solid ButtonBorder);
10
+ --rc-dialog-radius: var(--substrate-radius-xl, 1rem);
11
+ --rc-dialog-background: var(--substrate-surface-raised, Canvas);
12
+ --rc-dialog-color: var(--rc-field-text, CanvasText);
13
+ --rc-dialog-shadow: var(--substrate-shadow-lg, none);
14
+ }
15
+
2
16
  :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-dialog > dialog {
3
- border: var(--rc-border, 1px solid ButtonBorder);
4
- border-radius: var(--substrate-radius-xl, 1rem);
5
- background: var(--substrate-surface-raised, Canvas);
6
- color: var(--rc-field-text, CanvasText);
7
- box-shadow: var(--substrate-shadow-lg, none);
8
17
  opacity: 1;
9
- transform: translateY(0) scale(1);
10
18
  transition:
11
19
  display var(--substrate-motion-duration-slow, 240ms) allow-discrete,
12
20
  overlay var(--substrate-motion-duration-slow, 240ms) allow-discrete,
13
- opacity var(--substrate-motion-duration-slow, 240ms) var(--substrate-motion-easing, ease),
14
- transform var(--substrate-motion-duration-slow, 240ms) var(--substrate-motion-easing, ease);
21
+ opacity var(--substrate-motion-duration-slow, 240ms) var(--substrate-motion-easing, ease);
15
22
  transition-behavior: allow-discrete;
16
23
  }
17
24
 
18
25
  :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-dialog > dialog::backdrop {
19
- background: var(--rc-dialog-scrim, color-mix(in srgb, CanvasText 32%, transparent));
20
26
  transition: opacity var(--substrate-motion-duration-slow, 240ms)
21
27
  var(--substrate-motion-easing, ease);
22
28
  }
@@ -24,12 +30,10 @@
24
30
  @starting-style {
25
31
  :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-dialog > dialog[open] {
26
32
  opacity: 0;
27
- transform: translateY(0.5rem) scale(0.98);
28
33
  }
29
34
  }
30
35
 
31
36
  :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-dialog > dialog:not([open]) {
32
37
  opacity: 0;
33
- transform: translateY(0.5rem) scale(0.98);
34
38
  }
35
39
  }
@@ -1,52 +1,91 @@
1
1
  @layer rc-theme-substrate.components {
2
+ /*
3
+ * Maps Substrate tokens onto the public rc-disclosure properties, for both
4
+ * `rc-disclosure` and `rc-accordion`, since a panel reads the same properties
5
+ * either way. The boxes themselves are drawn by the component's own light-DOM
6
+ * base layer.
7
+ */
2
8
  :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-disclosure {
9
+ /*
10
+ * Layout stays in theme CSS so a disclosure is laid out before the element
11
+ * upgrades; only the property-driven drawing lives in the component's base
12
+ * layer, which needs JS to install.
13
+ */
3
14
  display: block;
4
15
  }
5
16
 
6
- :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-disclosure > details {
7
- border: var(--rc-border, 1px solid ButtonBorder);
8
- border-radius: var(--substrate-radius-lg, 0.75rem);
9
- background: var(--substrate-surface-raised, Canvas);
17
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate)) :is(rc-disclosure, rc-accordion) {
18
+ --rc-disclosure-border: var(--rc-border, 1px solid ButtonBorder);
19
+ --rc-disclosure-radius: var(--substrate-radius-lg, 0.75rem);
20
+ --rc-disclosure-background: var(--substrate-surface-raised, Canvas);
21
+ --rc-disclosure-color: var(--substrate-on-surface, CanvasText);
22
+ --rc-disclosure-open-shadow: var(--substrate-shadow-sm, none);
23
+
24
+ --rc-disclosure-summary-min-block-size: 2.75rem;
25
+ --rc-disclosure-summary-padding-block: 0.75rem;
26
+ --rc-disclosure-summary-padding-inline: 0.875rem;
27
+ --rc-disclosure-summary-gap: 0.75rem;
28
+ --rc-disclosure-summary-font: 650 var(--substrate-font-size, 0.95rem) /
29
+ var(--substrate-line-height, 1.45) var(--substrate-font-family, sans-serif);
30
+ --rc-disclosure-summary-hover-background: color-mix(
31
+ in srgb,
32
+ var(--rc-accent, Highlight) 8%,
33
+ transparent
34
+ );
35
+
36
+ --rc-disclosure-content-padding-block: 0 0.875rem;
37
+ --rc-disclosure-content-padding-inline: 0.875rem;
38
+ --rc-disclosure-content-color: var(--substrate-on-surface-muted, CanvasText);
39
+
40
+ --rc-disclosure-duration: var(--substrate-motion-spatial-duration-default, 240ms);
41
+ --rc-disclosure-easing: var(--substrate-motion-easing, ease);
42
+ }
43
+
44
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
45
+ :is(rc-disclosure, rc-accordion)
46
+ > details {
10
47
  overflow: clip;
11
48
  transition:
12
49
  border-color var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease),
13
50
  box-shadow var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
14
51
  }
15
52
 
16
- :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-disclosure > details[open] {
17
- box-shadow: var(--substrate-shadow-sm, none);
18
- }
19
-
20
- :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-disclosure > details > summary {
53
+ /*
54
+ * Substrate replaces the native marker with its own chevron, so it owns both
55
+ * halves of that swap: hiding `::marker` and drawing the affordance. Changing
56
+ * `display` here is safe precisely because this rule also supplies the
57
+ * replacement the lost `list-item` box would have drawn.
58
+ */
59
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
60
+ :is(rc-disclosure, rc-accordion)
61
+ > details
62
+ > summary {
21
63
  display: grid;
22
64
  grid-template-columns: minmax(0, 1fr) auto;
23
- gap: 0.75rem;
24
65
  align-items: center;
25
- min-block-size: 2.75rem;
26
- padding-block: 0.75rem;
27
- padding-inline: 0.875rem;
28
- cursor: pointer;
29
- font-weight: 650;
30
66
  transition:
31
67
  background-color var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease),
32
68
  color var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
33
69
  }
34
70
 
35
71
  :where(.rc-theme-substrate, :host(.rc-theme-substrate))
36
- rc-disclosure
72
+ :is(rc-disclosure, rc-accordion)
37
73
  > details
38
74
  > summary::marker {
39
75
  content: '';
40
76
  }
41
77
 
42
78
  :where(.rc-theme-substrate, :host(.rc-theme-substrate))
43
- rc-disclosure
79
+ :is(rc-disclosure, rc-accordion)
44
80
  > details
45
81
  > summary::-webkit-details-marker {
46
82
  display: none;
47
83
  }
48
84
 
49
- :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-disclosure > details > summary::after {
85
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
86
+ :is(rc-disclosure, rc-accordion)
87
+ > details
88
+ > summary::after {
50
89
  content: '';
51
90
  inline-size: 0.5rem;
52
91
  block-size: 0.5rem;
@@ -59,62 +98,17 @@
59
98
  }
60
99
 
61
100
  :where(.rc-theme-substrate, :host(.rc-theme-substrate))
62
- rc-disclosure
101
+ :is(rc-disclosure, rc-accordion)
63
102
  > details[open]
64
103
  > summary::after {
65
104
  rotate: 135deg;
66
105
  translate: 0 -0.125rem;
67
106
  }
68
107
 
69
- :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-disclosure > details > summary:hover {
70
- background: color-mix(in srgb, var(--rc-accent, Highlight) 8%, transparent);
71
- }
72
-
73
- :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-disclosure > details > :not(summary) {
108
+ :where(.rc-theme-substrate, :host(.rc-theme-substrate))
109
+ :is(rc-disclosure, rc-accordion)
110
+ > details
111
+ > :not(summary) {
74
112
  display: flow-root;
75
- padding-inline: 0.875rem;
76
- opacity: 1;
77
- transition:
78
- opacity var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease),
79
- translate var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
80
- }
81
-
82
- @supports selector(::details-content) {
83
- :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-disclosure > details {
84
- interpolate-size: allow-keywords;
85
- }
86
-
87
- :where(.rc-theme-substrate, :host(.rc-theme-substrate))
88
- rc-disclosure
89
- > details::details-content {
90
- block-size: 0;
91
- content-visibility: hidden;
92
- opacity: 0;
93
- overflow: clip;
94
- transition:
95
- block-size var(--substrate-motion-duration-slow, 240ms) var(--substrate-motion-easing, ease),
96
- content-visibility var(--substrate-motion-duration-slow, 240ms)
97
- var(--substrate-motion-easing, ease) allow-discrete,
98
- opacity var(--rc-motion-duration, 160ms) var(--substrate-motion-easing, ease);
99
- transition-behavior: allow-discrete;
100
- }
101
-
102
- :where(.rc-theme-substrate, :host(.rc-theme-substrate))
103
- rc-disclosure
104
- > details[open]::details-content {
105
- block-size: auto;
106
- content-visibility: visible;
107
- opacity: 1;
108
- }
109
- }
110
-
111
- @starting-style {
112
- :where(.rc-theme-substrate, :host(.rc-theme-substrate))
113
- rc-disclosure
114
- > details[open]
115
- > :not(summary) {
116
- opacity: 0;
117
- translate: 0 -0.25rem;
118
- }
119
113
  }
120
114
  }
@@ -10,10 +10,10 @@
10
10
  --rc-fab-menu-bg-hover: var(--rc-fab-menu-bg);
11
11
  --rc-fab-menu-bg-open: var(--rc-fab-menu-bg-hover);
12
12
  --rc-fab-menu-color: var(--rc-on-accent, HighlightText);
13
- --rc-fab-menu-shadow: var(--substrate-shadow-raised, var(--rc-shadow-level2, none));
14
- --rc-fab-menu-shadow-hover: var(--substrate-shadow-overlay, var(--rc-shadow-level3, none));
13
+ --rc-fab-menu-shadow: var(--substrate-shadow-md, var(--rc-shadow-level2, none));
14
+ --rc-fab-menu-shadow-hover: var(--substrate-shadow-lg, var(--rc-shadow-level3, none));
15
15
  --rc-fab-menu-shadow-open: var(--rc-fab-menu-shadow-hover);
16
- --rc-fab-menu-shadow-active: var(--substrate-shadow-raised, var(--rc-shadow-level2, none));
16
+ --rc-fab-menu-shadow-active: var(--substrate-shadow-md, var(--rc-shadow-level2, none));
17
17
  --rc-fab-menu-radius: var(--substrate-radius-lg, 1rem);
18
18
  --rc-fab-menu-font: inherit;
19
19
  --rc-fab-menu-font-family: inherit;
@@ -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
+ }
@@ -5,8 +5,6 @@
5
5
  --rc-list-item-min-block-size: 2.25rem;
6
6
  --rc-list-item-padding-block: var(--substrate-item-padding-block, 0.55rem);
7
7
  --rc-list-item-padding-inline: var(--substrate-item-padding-inline, 0.75rem);
8
- --rc-list-item-bg: transparent;
9
- --rc-list-item-supporting-color: var(--substrate-on-surface-muted, GrayText);
10
8
  --rc-list-item-hover-bg: color-mix(in srgb, var(--rc-accent, Highlight) 10%, transparent);
11
9
  --rc-list-item-active-bg: color-mix(in srgb, var(--rc-accent, Highlight) 16%, transparent);
12
10
  --rc-list-item-selected-bg: var(--rc-highlight, Highlight);
@@ -25,13 +23,13 @@
25
23
  --rc-list-item-background: transparent;
26
24
  --rc-list-item-selected-color: var(--rc-highlight-text, HighlightText);
27
25
  --rc-list-item-selected-background: var(--rc-highlight, Highlight);
28
- --rc-list-item-divider: 1px solid var(--substrate-border, GrayText);
26
+ --rc-list-item-divider: 1px solid var(--substrate-border-color, GrayText);
29
27
  --rc-list-item-state-layer-color: var(--rc-accent, Highlight);
30
28
  --rc-list-item-hover-state-layer-opacity: 0.1;
31
29
  --rc-list-item-focus-state-layer-opacity: 0.12;
32
30
  --rc-list-item-pressed-state-layer-opacity: 0.16;
33
31
  --rc-list-item-disabled-opacity: var(--rc-disabled-opacity, 0.52);
34
- --rc-list-item-transition-duration: 100ms;
32
+ --rc-list-item-transition-duration: var(--rc-motion-effects-duration-fast, 100ms);
35
33
  }
36
34
 
37
35
  :where(.rc-theme-substrate, :host(.rc-theme-substrate)) rc-list[variant='segmented'] {
@@ -39,8 +37,8 @@
39
37
  --rc-list-row-gap: 0.25rem;
40
38
  --rc-list-item-background: var(--substrate-surface-raised, Field);
41
39
  --rc-list-item-divider: 0;
42
- --rc-list-item-border: 1px solid var(--substrate-border, GrayText);
43
- --rc-list-item-border-radius: var(--substrate-radius-medium, 0.375rem);
40
+ --rc-list-item-border: 1px solid var(--substrate-border-color, GrayText);
41
+ --rc-list-item-border-radius: var(--substrate-radius-md, 0.375rem);
44
42
  }
45
43
 
46
44
  :where(.rc-theme-substrate, :host(.rc-theme-substrate))
@@ -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) var(--substrate-motion-easing, ease),
9
- color var(--substrate-motion-duration, 160ms) var(--substrate-motion-easing, ease);
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);