@rcarls/rc-theme-material 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.
Files changed (57) hide show
  1. package/CHANGELOG.md +600 -0
  2. package/DESIGN.md +1399 -0
  3. package/README.md +138 -5
  4. package/bridge.css +150 -55
  5. package/components/accordion.css +43 -157
  6. package/components/adaptive-menu.css +123 -0
  7. package/components/app-bar.css +49 -7
  8. package/components/bottom-sheet.css +10 -7
  9. package/components/button.css +215 -2
  10. package/components/card.css +2 -0
  11. package/components/carousel.css +23 -0
  12. package/components/chip-group.css +15 -0
  13. package/components/chip.css +12 -1
  14. package/components/combobox.css +68 -14
  15. package/components/dialog.css +77 -15
  16. package/components/disclosure.css +128 -84
  17. package/components/field.css +566 -0
  18. package/components/icons.css +48 -6
  19. package/components/list-item.css +142 -32
  20. package/components/listbox.css +5 -4
  21. package/components/markdown-editor.css +62 -35
  22. package/components/menu-button.css +105 -1
  23. package/components/menu.css +32 -16
  24. package/components/menubar.css +4 -1
  25. package/components/modes.css +36 -17
  26. package/components/navigation-bar.css +3 -5
  27. package/components/navigation-rail.css +5 -7
  28. package/components/popover.css +50 -0
  29. package/components/progress.css +15 -0
  30. package/components/range-slider.css +8 -3
  31. package/components/scroller.css +7 -0
  32. package/components/search-bar.css +12 -2
  33. package/components/segmented-button.css +2 -28
  34. package/components/select.css +106 -14
  35. package/components/splitter.css +4 -1
  36. package/components/switch.css +9 -1
  37. package/components/textarea.css +13 -3
  38. package/components/toolbar.css +2 -1
  39. package/components/tooltip.css +12 -0
  40. package/components/transfer-list.css +5 -1
  41. package/components/virtual-canvas.css +4 -1
  42. package/components/virtual-scroller.css +7 -0
  43. package/components.css +11 -1
  44. package/constraints/material.json +99 -0
  45. package/css-components/button.css +66 -0
  46. package/css-components/card.css +14 -0
  47. package/css-components/chip-group.css +9 -0
  48. package/css-components/chip.css +80 -0
  49. package/css-components/disclosure.css +25 -0
  50. package/css-components/list.css +34 -0
  51. package/css-components/select.css +20 -0
  52. package/css-components/textarea.css +22 -0
  53. package/css-components.css +31 -0
  54. package/defaults.css +329 -14
  55. package/native.css +258 -0
  56. package/package.json +21 -2
  57. package/state-layer.css +5 -1
@@ -1,181 +1,67 @@
1
1
  @layer rc-theme-material.components {
2
+ /*
3
+ * Only the group box and the panel shapes. Panels inside an accordion take
4
+ * the same `--rc-disclosure-*` mapping as a standalone disclosure, which
5
+ * disclosure.css sets for `rc-accordion` as well, so the panel recipe is not
6
+ * repeated here.
7
+ */
2
8
  :where(.rc-theme-material, :host(.rc-theme-material)) rc-accordion {
9
+ /*
10
+ * Grouped like a segmented `rc-list`: a 2px gap, no outline, extra-small
11
+ * inner corners, and extra-large outer corners on the first and last panel,
12
+ * so an accordion reads as one expandable list rather than a card stack.
13
+ */
14
+ --rc-accordion-gap: 0.125rem;
15
+
16
+ /* Laid out before the element upgrades; see disclosure.css. */
3
17
  display: grid;
4
- gap: 0.5rem;
18
+ gap: var(--rc-accordion-gap, 0.125rem);
5
19
  border: 0;
6
20
  background: transparent;
7
- --rc-theme-material-accordion-easing: cubic-bezier(
8
- var(--md-sys-motion-easing-standard-x0, 0.2),
9
- var(--md-sys-motion-easing-standard-y0, 0),
10
- var(--md-sys-motion-easing-standard-x1, 0),
11
- var(--md-sys-motion-easing-standard-y1, 1)
12
- );
13
21
  }
14
22
 
15
23
  :where(.rc-theme-material, :host(.rc-theme-material)) rc-accordion > rc-disclosure {
16
24
  display: block;
17
25
  }
18
26
 
19
- :where(.rc-theme-material, :host(.rc-theme-material)) rc-accordion > details,
20
- :where(.rc-theme-material, :host(.rc-theme-material)) rc-accordion > rc-disclosure > details {
21
- overflow: clip;
22
- border: 1px solid var(--md-sys-color-outline-variant, ButtonBorder);
23
- border-radius: var(--md-sys-shape-corner-large, 1rem);
24
- background: var(--md-sys-color-surface-container-low, Canvas);
25
- color: var(--md-sys-color-on-surface, CanvasText);
26
- transition:
27
- background-color var(--md-sys-motion-duration-200, 200ms)
28
- var(--rc-theme-material-accordion-easing),
29
- border-color var(--md-sys-motion-duration-200, 200ms)
30
- var(--rc-theme-material-accordion-easing),
31
- box-shadow var(--md-sys-motion-duration-200, 200ms) var(--rc-theme-material-accordion-easing);
32
- }
33
-
34
- :where(.rc-theme-material, :host(.rc-theme-material)) rc-accordion > details[open],
35
- :where(.rc-theme-material, :host(.rc-theme-material))
36
- rc-accordion
37
- > rc-disclosure
38
- > details[open] {
39
- background: var(--md-sys-color-surface-container, Canvas);
40
- box-shadow: var(
41
- --rc-shadow-level1,
42
- 0 1px 2px 0 rgb(0 0 0 / 0.3),
43
- 0 1px 3px 1px rgb(0 0 0 / 0.15)
44
- );
45
- }
46
-
47
- :where(.rc-theme-material, :host(.rc-theme-material)) rc-accordion > details > summary,
48
- :where(.rc-theme-material, :host(.rc-theme-material))
49
- rc-accordion
50
- > rc-disclosure
51
- > details
52
- > summary {
53
- display: grid;
54
- grid-template-columns: minmax(0, 1fr);
55
- align-items: center;
56
- box-sizing: border-box;
57
- min-block-size: 3.5rem;
58
- padding-block: 0.75rem;
59
- padding-inline: 1rem;
60
- border-radius: calc(var(--md-sys-shape-corner-large, 1rem) - 1px);
61
- color: var(--md-sys-color-on-surface, CanvasText);
62
- cursor: pointer;
63
- font-family: var(--md-sys-typescale-title-small-font, inherit);
64
- font-size: var(--md-sys-typescale-title-small-size, 0.875rem);
65
- font-weight: var(--md-sys-typescale-title-small-weight, 500);
66
- line-height: var(--md-sys-typescale-title-small-line-height, 1.25rem);
67
- transition: background-color var(--md-sys-motion-duration-100, 100ms)
68
- var(--rc-theme-material-accordion-easing);
69
- }
70
-
71
- :where(.rc-theme-material, :host(.rc-theme-material)) rc-accordion > details > summary::marker,
72
- :where(.rc-theme-material, :host(.rc-theme-material))
73
- rc-accordion
74
- > rc-disclosure
75
- > details
76
- > summary::marker {
77
- color: var(--md-sys-color-on-surface-variant, GrayText);
78
- }
79
-
80
- :where(.rc-theme-material, :host(.rc-theme-material)) rc-accordion > details > summary:hover,
81
- :where(.rc-theme-material, :host(.rc-theme-material))
82
- rc-accordion
83
- > rc-disclosure
84
- > details
85
- > summary:hover {
86
- background: color-mix(in srgb, var(--md-sys-color-on-surface, CanvasText) 8%, transparent);
87
- background: color-mix(
88
- in srgb,
89
- var(--md-sys-color-on-surface, CanvasText)
90
- calc(var(--md-sys-state-hover-state-layer-opacity, 0.08) * 100%),
91
- transparent
92
- );
27
+ /*
28
+ * Set on the items, not inherited from the group: disclosure.css maps the
29
+ * standalone outline and radius onto every `rc-disclosure`, wrapped or not.
30
+ */
31
+ :where(.rc-theme-material, :host(.rc-theme-material)) rc-accordion > :is(rc-disclosure, details) {
32
+ --rc-disclosure-border: 0;
33
+ --rc-disclosure-radius: var(--md-sys-shape-corner-extra-small, 0.25rem);
93
34
  }
94
35
 
36
+ /* Shape both the native panel and its summary hover surface at logical ends. */
95
37
  :where(.rc-theme-material, :host(.rc-theme-material))
96
- rc-accordion
97
- > details
98
- > summary:focus-visible,
99
- :where(.rc-theme-material, :host(.rc-theme-material))
100
- rc-accordion
101
- > rc-disclosure
102
- > details
103
- > summary:focus-visible {
104
- outline: var(--rc-focus-ring, 2px solid Highlight);
105
- outline-offset: -2px;
38
+ :is(
39
+ rc-accordion > details:first-child,
40
+ rc-accordion > details:first-child > summary,
41
+ rc-accordion > rc-disclosure:first-child > details,
42
+ rc-accordion > rc-disclosure:first-child > details > summary
43
+ ) {
44
+ border-start-start-radius: var(--md-sys-shape-corner-extra-large, 1.75rem);
45
+ border-start-end-radius: var(--md-sys-shape-corner-extra-large, 1.75rem);
106
46
  }
107
47
 
108
- :where(.rc-theme-material, :host(.rc-theme-material)) rc-accordion > details > :not(summary),
109
48
  :where(.rc-theme-material, :host(.rc-theme-material))
110
- rc-accordion
111
- > rc-disclosure
112
- > details
113
- > :not(summary) {
114
- box-sizing: border-box;
115
- max-block-size: 0;
116
- overflow: clip;
117
- padding-block: 0;
118
- padding-inline: 1rem;
119
- color: var(--md-sys-color-on-surface-variant, CanvasText);
120
- font-family: var(--md-sys-typescale-body-medium-font, inherit);
121
- font-size: var(--md-sys-typescale-body-medium-size, 0.875rem);
122
- line-height: var(--md-sys-typescale-body-medium-line-height, 1.25rem);
123
- opacity: 0;
124
- transition:
125
- max-block-size var(--md-sys-motion-duration-300, 300ms)
126
- var(--rc-theme-material-accordion-easing),
127
- opacity var(--md-sys-motion-duration-200, 200ms) var(--rc-theme-material-accordion-easing),
128
- padding-block var(--md-sys-motion-duration-200, 200ms)
129
- var(--rc-theme-material-accordion-easing);
49
+ :is(
50
+ rc-accordion > details:last-child,
51
+ rc-accordion > details:last-child > summary,
52
+ rc-accordion > rc-disclosure:last-child > details,
53
+ rc-accordion > rc-disclosure:last-child > details > summary
54
+ ) {
55
+ border-end-start-radius: var(--md-sys-shape-corner-extra-large, 1.75rem);
56
+ border-end-end-radius: var(--md-sys-shape-corner-extra-large, 1.75rem);
130
57
  }
131
58
 
132
- :where(.rc-theme-material, :host(.rc-theme-material))
133
- rc-accordion
134
- > details[open]
135
- > :not(summary),
136
- :where(.rc-theme-material, :host(.rc-theme-material))
137
- rc-accordion
138
- > rc-disclosure
139
- > details[open]
140
- > :not(summary) {
141
- max-block-size: 60rem;
142
- padding-block: 0 1rem;
143
- opacity: 1;
144
- }
145
-
146
- @supports (transition-behavior: allow-discrete) {
147
- :where(.rc-theme-material, :host(.rc-theme-material)) rc-accordion > details > :not(summary),
148
- :where(.rc-theme-material, :host(.rc-theme-material))
149
- rc-accordion
150
- > rc-disclosure
151
- > details
152
- > :not(summary) {
153
- transition:
154
- content-visibility var(--md-sys-motion-duration-300, 300ms) allow-discrete,
155
- max-block-size var(--md-sys-motion-duration-300, 300ms)
156
- var(--rc-theme-material-accordion-easing),
157
- opacity var(--md-sys-motion-duration-200, 200ms) var(--rc-theme-material-accordion-easing),
158
- padding-block var(--md-sys-motion-duration-200, 200ms)
159
- var(--rc-theme-material-accordion-easing);
160
- }
161
- }
162
-
163
- @media (prefers-reduced-motion: reduce) {
164
- :where(.rc-theme-material, :host(.rc-theme-material)) rc-accordion > details,
165
- :where(.rc-theme-material, :host(.rc-theme-material)) rc-accordion > rc-disclosure > details,
166
- :where(.rc-theme-material, :host(.rc-theme-material)) rc-accordion > details > summary,
167
- :where(.rc-theme-material, :host(.rc-theme-material))
168
- rc-accordion
169
- > rc-disclosure
170
- > details
171
- > summary,
172
- :where(.rc-theme-material, :host(.rc-theme-material)) rc-accordion > details > :not(summary),
59
+ /* Without the surface fills, gaps alone would not separate the panels. */
60
+ @media (forced-colors: active) {
173
61
  :where(.rc-theme-material, :host(.rc-theme-material))
174
62
  rc-accordion
175
- > rc-disclosure
176
- > details
177
- > :not(summary) {
178
- transition-duration: 0ms;
63
+ > :is(rc-disclosure, details) {
64
+ --rc-disclosure-border: 1px solid CanvasText;
179
65
  }
180
66
  }
181
67
  }
@@ -0,0 +1,123 @@
1
+ @layer rc-theme-material.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-material, :host(.rc-theme-material)) {
7
+ --rc-adaptive-menu-gap: 0;
8
+ --rc-adaptive-menu-trigger-inline-size: 2rem;
9
+ --rc-adaptive-menu-trigger-block-size: 2.5rem;
10
+ --rc-adaptive-menu-touch-target-block-size: 3rem;
11
+ /*
12
+ * Unlike rc-button's narrow variant (opt-in, usable anywhere), the
13
+ * overflow trigger is always the trailing-most control in its toolbar
14
+ * by design -- there's no legitimate placement where something else
15
+ * needs the space this reclaims -- so this defaults unconditionally
16
+ * rather than needing its own opt-in variant. (3rem touch target - 2rem
17
+ * trigger-inline-size) / 2, matching --rc-adaptive-menu-trigger-inline-size
18
+ * above.
19
+ */
20
+ --rc-adaptive-menu-touch-target-overlap-inline-end: 0.5rem;
21
+ --rc-adaptive-menu-trigger-padding: 0.25rem;
22
+ --rc-adaptive-menu-trigger-border: 0;
23
+ --rc-adaptive-menu-trigger-radius: var(--md-sys-shape-corner-full, 9999px);
24
+ --rc-adaptive-menu-trigger-background: transparent;
25
+ --rc-adaptive-menu-trigger-color: var(--md-sys-color-on-surface-variant, ButtonText);
26
+ --rc-adaptive-menu-trigger-hover-background: color-mix(
27
+ in srgb,
28
+ var(--md-sys-color-on-surface-variant, CanvasText)
29
+ calc(var(--md-sys-state-hover-state-layer-opacity, 0.08) * 100%),
30
+ transparent
31
+ );
32
+ --rc-adaptive-menu-icon-size: 1.5rem;
33
+ --rc-adaptive-menu-popup-min-inline-size: 7rem;
34
+ --rc-adaptive-menu-item-min-block-size: 3rem;
35
+ --rc-adaptive-menu-item-padding-block: 0;
36
+ --rc-adaptive-menu-item-padding-inline: 0.75rem;
37
+ --rc-adaptive-menu-item-gap: 0.75rem;
38
+ }
39
+
40
+ :where(.rc-theme-material, :host(.rc-theme-material))
41
+ rc-adaptive-menu
42
+ > [data-rc-action-promoted]:has([data-rc-menu-leading])
43
+ [data-rc-menu-label] {
44
+ position: absolute;
45
+ inline-size: 1px;
46
+ block-size: 1px;
47
+ padding: 0;
48
+ margin: -1px;
49
+ overflow: hidden;
50
+ clip-path: inset(50%);
51
+ white-space: nowrap;
52
+ }
53
+
54
+ :where(.rc-theme-material, :host(.rc-theme-material))
55
+ rc-adaptive-menu
56
+ > rc-menu-button[data-rc-action-promoted] {
57
+ --rc-menu-button-indicator-size: 0px;
58
+ --rc-menu-button-indicator-inset: 0px;
59
+ }
60
+
61
+ :where(.rc-theme-material, :host(.rc-theme-material))
62
+ rc-adaptive-menu
63
+ > rc-menu-button[data-rc-action-promoted]
64
+ > [slot='indicator'] {
65
+ display: none;
66
+ }
67
+ }
68
+
69
+ /*
70
+ * An action rc-adaptive-menu moves into its overflow renders as a menu row.
71
+ * rc-adaptive-menu maps the action's own tokens onto its item tokens in rc-base,
72
+ * which sits below every theme layer, so this layer repeats the mapping above the
73
+ * theme's button and menu-button variants (filled, tonal, icon-only sizes, and so
74
+ * on) that would otherwise restyle the row as a standalone control.
75
+ */
76
+ @layer rc-theme-material.overrides {
77
+ :where(.rc-theme-material, :host(.rc-theme-material))
78
+ rc-adaptive-menu
79
+ > rc-button[data-rc-action-overflowed] {
80
+ --rc-button-block-size: var(--rc-adaptive-menu-item-min-block-size, 2.5em);
81
+ --rc-button-icon-size: 100%;
82
+ --rc-button-touch-target-inline-size: 100%;
83
+ --rc-button-touch-target-block-size: var(--rc-adaptive-menu-item-min-block-size, 2.5em);
84
+ --rc-button-padding-inline: var(
85
+ --rc-adaptive-menu-item-padding-inline,
86
+ var(--rc-item-padding-inline, 0.75em)
87
+ );
88
+ --rc-button-padding-block: var(
89
+ --rc-adaptive-menu-item-padding-block,
90
+ var(--rc-item-padding-block, 0.3em)
91
+ );
92
+ --rc-button-radius: 0;
93
+ --rc-button-bg: transparent;
94
+ --rc-button-color: currentColor;
95
+ --rc-button-border: 0;
96
+ --rc-button-state-layer-bg: currentColor;
97
+ --rc-button-progress-color: currentColor;
98
+ }
99
+
100
+ :where(.rc-theme-material, :host(.rc-theme-material))
101
+ rc-adaptive-menu
102
+ > rc-menu-button[data-rc-action-overflowed] {
103
+ --rc-menu-button-trigger-block-size: var(--rc-adaptive-menu-item-min-block-size, 2.5em);
104
+ --rc-menu-button-icon-size: 100%;
105
+ --rc-menu-button-touch-target-inline-size: 100%;
106
+ --rc-menu-button-touch-target-block-size: var(--rc-adaptive-menu-item-min-block-size, 2.5em);
107
+ --rc-menu-button-trigger-padding-block: var(
108
+ --rc-adaptive-menu-item-padding-block,
109
+ var(--rc-item-padding-block, 0.3em)
110
+ );
111
+ --rc-menu-button-trigger-padding-inline: var(
112
+ --rc-adaptive-menu-item-padding-inline,
113
+ var(--rc-item-padding-inline, 0.75em)
114
+ );
115
+ --rc-menu-button-trigger-gap: var(--rc-adaptive-menu-item-gap, var(--rc-item-gap, 0.5em));
116
+ --rc-menu-button-trigger-radius: 0;
117
+ --rc-menu-button-trigger-border: 0;
118
+ --rc-menu-button-trigger-background: transparent;
119
+ --rc-menu-button-trigger-color: currentColor;
120
+ --rc-menu-button-trigger-hover-color: currentColor;
121
+ --rc-menu-button-trigger-open-color: currentColor;
122
+ }
123
+ }
@@ -3,8 +3,10 @@
3
3
  box-shadow: var(--rc-shadow-level0, none);
4
4
  font-family: var(--md-sys-typescale-title-large-font, inherit);
5
5
  transition:
6
- box-shadow 200ms ease,
7
- translate 200ms ease;
6
+ box-shadow var(--rc-motion-effects-duration-default, 200ms)
7
+ var(--rc-motion-effects-easing-default, ease),
8
+ translate var(--rc-motion-spatial-duration-default, 400ms)
9
+ var(--rc-motion-spatial-easing-default, ease);
8
10
  }
9
11
 
10
12
  :where(.rc-theme-material, :host(.rc-theme-material)) rc-app-bar[data-scrolled] {
@@ -12,19 +14,59 @@
12
14
  box-shadow: var(--rc-shadow-level2, none);
13
15
  }
14
16
 
15
- :where(.rc-theme-material, :host(.rc-theme-material)) rc-app-bar :is(button, [role='button']) {
16
- inline-size: 3rem;
17
- block-size: 3rem;
18
- padding: 0.75rem;
17
+ /*
18
+ * A bare <button>/[role=button] dropped directly into an rc-app-bar's
19
+ * leading or trailing action slot gets full M3 icon-button treatment on
20
+ * its own — MD3 "Small" icon button: 40dp visual container / 24dp icon —
21
+ * without needing rc-button. Scoped to a *direct* child
22
+ * (`>`, not a descendant combinator): a button nested inside an
23
+ * `rc-button`/`rc-menu-button` slotted here is several levels deeper in
24
+ * the light DOM and already has its own correct sizing from that
25
+ * component's own theming; a descendant selector here would reach
26
+ * straight through and fight it.
27
+ */
28
+ :where(.rc-theme-material, :host(.rc-theme-material))
29
+ rc-app-bar
30
+ > :is(button, [role='button']):is([slot='leading'], [slot='trailing']) {
31
+ box-sizing: border-box;
32
+ position: relative;
33
+ display: inline-grid;
34
+ place-items: center;
35
+ inline-size: 2.5rem;
36
+ block-size: 2.5rem;
37
+ padding: 0;
19
38
  border: 0;
20
39
  border-radius: var(--md-sys-shape-corner-full, 999px);
21
40
  background: transparent;
22
41
  color: inherit;
23
42
  }
24
43
 
44
+ /* Accessible touch-target floor, decoupled from the visual size above —
45
+ the same affordance rc-button's own icon-only buttons provide. A
46
+ no-op once the visible button already meets or exceeds it. */
47
+ :where(.rc-theme-material, :host(.rc-theme-material))
48
+ rc-app-bar
49
+ > :is(button, [role='button']):is([slot='leading'], [slot='trailing'])::before {
50
+ content: '';
51
+ position: absolute;
52
+ inset: calc((3rem - max(100%, 2.5rem)) / -2);
53
+ }
54
+
55
+ /* Sizes the button's own content (typically a single icon) to the MD3
56
+ icon-button glyph size, regardless of whether it carries a marker
57
+ attribute — a direct child of an app-bar action button is
58
+ unambiguously its icon. */
59
+ :where(.rc-theme-material, :host(.rc-theme-material))
60
+ rc-app-bar
61
+ > :is(button, [role='button']):is([slot='leading'], [slot='trailing'])
62
+ > * {
63
+ font-size: 1.5rem;
64
+ line-height: 1.5rem;
65
+ }
66
+
25
67
  :where(.rc-theme-material, :host(.rc-theme-material))
26
68
  rc-app-bar
27
- :is(button, [role='button']):hover {
69
+ > :is(button, [role='button']):is([slot='leading'], [slot='trailing']):hover {
28
70
  background: color-mix(in srgb, var(--md-sys-color-on-surface, CanvasText) 8%, transparent);
29
71
  }
30
72
 
@@ -1,6 +1,6 @@
1
1
  @layer rc-theme-material.components {
2
2
  :where(.rc-theme-material, :host(.rc-theme-material)) rc-bottom-sheet {
3
- --rc-bottom-sheet-bg: var(--md-sys-color-surface, Canvas);
3
+ --rc-bottom-sheet-bg: var(--md-sys-color-surface-container-low, Canvas);
4
4
  --rc-bottom-sheet-handle-color: color-mix(
5
5
  in srgb,
6
6
  var(--md-sys-color-on-surface-variant, GrayText) 40%,
@@ -8,7 +8,7 @@
8
8
  );
9
9
  --rc-bottom-sheet-handle-radius: var(--md-sys-shape-corner-full, 999px);
10
10
  --rc-bottom-sheet-handle-target-block-size: 3rem;
11
- --rc-bottom-sheet-snap-duration: var(--rc-motion-spatial-duration-default, 500ms);
11
+ --rc-bottom-sheet-snap-duration: var(--rc-motion-spatial-duration-fast, 300ms);
12
12
  --rc-bottom-sheet-snap-easing: var(
13
13
  --rc-motion-spatial-easing-default,
14
14
  cubic-bezier(0.2, 0, 0, 1)
@@ -28,7 +28,7 @@
28
28
  overflow: auto;
29
29
  border: 0;
30
30
  border-radius: var(--rc-bottom-sheet-radius, 1.75rem 1.75rem 0 0);
31
- background: var(--rc-bottom-sheet-bg, var(--md-sys-color-surface, Canvas));
31
+ background: var(--rc-bottom-sheet-bg, var(--md-sys-color-surface-container-low, Canvas));
32
32
  color: var(--rc-bottom-sheet-color, var(--md-sys-color-on-surface, CanvasText));
33
33
  box-shadow: var(--rc-bottom-sheet-shadow, var(--rc-shadow-level1, none));
34
34
  font-family: var(--md-sys-typescale-body-medium-font, inherit);
@@ -41,10 +41,13 @@
41
41
  );
42
42
  }
43
43
 
44
+ /* Descendant (not child) combinator: consuming apps may nest the handle
45
+ inside their own peek-content wrapper (e.g. grouped with a summary
46
+ row) rather than placing it as a direct child of dialog. */
44
47
  :where(.rc-theme-material, :host(.rc-theme-material))
45
48
  rc-bottom-sheet
46
49
  > dialog
47
- > [data-rc-bottom-sheet-handle] {
50
+ [data-rc-bottom-sheet-handle] {
48
51
  position: relative;
49
52
  display: block;
50
53
  inline-size: var(--rc-bottom-sheet-handle-target-inline-size, 100%);
@@ -63,10 +66,10 @@
63
66
  :where(.rc-theme-material, :host(.rc-theme-material))
64
67
  rc-bottom-sheet
65
68
  > dialog
66
- > [data-rc-bottom-sheet-handle]::before {
69
+ [data-rc-bottom-sheet-handle]::before {
67
70
  content: '';
68
71
  position: absolute;
69
- inset-block-start: 50%;
72
+ inset-block-start: var(--rc-bottom-sheet-handle-offset, 50%);
70
73
  inset-inline-start: 50%;
71
74
  inline-size: var(--rc-bottom-sheet-handle-inline-size, 2rem);
72
75
  block-size: var(--rc-bottom-sheet-handle-block-size, 0.25rem);
@@ -78,7 +81,7 @@
78
81
  :where(.rc-theme-material, :host(.rc-theme-material))
79
82
  rc-bottom-sheet
80
83
  > dialog
81
- > [data-rc-bottom-sheet-handle]:focus-visible {
84
+ [data-rc-bottom-sheet-handle]:focus-visible {
82
85
  outline: 0.125rem solid var(--md-sys-color-primary, Highlight);
83
86
  outline-offset: -0.25rem;
84
87
  }