@rcarls/rc-theme-material 0.0.0-next-20260921045401
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 +423 -0
- package/README.md +164 -0
- package/bridge.css +678 -0
- package/components/accordion.css +20 -0
- package/components/adaptive-menu.css +162 -0
- package/components/app-bar.css +100 -0
- package/components/bottom-sheet.css +135 -0
- package/components/button.css +270 -0
- package/components/card.css +61 -0
- package/components/carousel.css +23 -0
- package/components/chip-group.css +15 -0
- package/components/chip.css +39 -0
- package/components/combobox.css +155 -0
- package/components/dialog.css +86 -0
- package/components/disclosure.css +104 -0
- package/components/fab-menu.css +85 -0
- package/components/fab.css +51 -0
- package/components/field.css +378 -0
- package/components/icons.css +52 -0
- package/components/list-item.css +146 -0
- package/components/listbox.css +47 -0
- package/components/markdown-editor.css +72 -0
- package/components/menu-button.css +126 -0
- package/components/menu.css +147 -0
- package/components/menubar.css +27 -0
- package/components/modes.css +50 -0
- package/components/navigation-bar.css +76 -0
- package/components/navigation-rail.css +132 -0
- package/components/progress.css +15 -0
- package/components/range-slider.css +29 -0
- package/components/scroller.css +7 -0
- package/components/search-bar.css +58 -0
- package/components/segmented-button.css +19 -0
- package/components/select.css +197 -0
- package/components/slider.css +19 -0
- package/components/snackbar.css +23 -0
- package/components/splitter.css +35 -0
- package/components/switch.css +41 -0
- package/components/textarea.css +31 -0
- package/components/toolbar.css +32 -0
- package/components/transfer-list.css +70 -0
- package/components/virtual-canvas.css +16 -0
- package/components.css +42 -0
- package/constraints/material.json +99 -0
- package/defaults.css +1081 -0
- package/package.json +53 -0
- package/state-layer.css +35 -0
- package/theme.css +3 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
# @rcarls/rc-theme-material
|
|
2
|
+
|
|
3
|
+
## 0.0.0-next-20260921045401
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 079e025: Standardize component styling contracts for the breaking 0.7 release.
|
|
8
|
+
|
|
9
|
+
BREAKING CHANGE: Rename the Markdown editor's `--rme-*` properties to
|
|
10
|
+
`--rc-markdown-editor-*`, `--rc-app-bar-background` to `--rc-app-bar-bg`,
|
|
11
|
+
`--rc-textarea-radius` to `--rc-textarea-border-radius`, the transfer-list
|
|
12
|
+
`--rc-transfer-list-panel-*` properties to `--rc-transfer-list-listbox-*`,
|
|
13
|
+
`--rc-chip-group-webkit-scrollbar-display` to
|
|
14
|
+
`--rc-chip-group-scrollbar-display`, and `--rc-text` to `--rc-field-text`.
|
|
15
|
+
Compatibility aliases are intentionally not provided.
|
|
16
|
+
|
|
17
|
+
BREAKING CHANGE: Replace `--rc-select-chip-padding-inline` and
|
|
18
|
+
`--rc-combobox-chip-padding-inline` with explicit `*-padding-inline-start` and
|
|
19
|
+
`*-padding-inline-end` tokens. Generated removable chips now reserve the full
|
|
20
|
+
remove target and its edge offset, so their indicator cannot overlap label text.
|
|
21
|
+
|
|
22
|
+
Add canonical app-bar elevation, transfer-list listbox radius, and textarea
|
|
23
|
+
line-action tokens. Add logical `rc-chip` inline-padding properties so themes
|
|
24
|
+
can implement Material's icon-aware spacing without overriding authored child
|
|
25
|
+
styles. Make `rc-field` consume the shared semantic token layer,
|
|
26
|
+
and place the `rc-chip` and `rc-search-bar` light-DOM structural styles in the
|
|
27
|
+
`rc-base` cascade layer so normal consumer rules override them.
|
|
28
|
+
|
|
29
|
+
Prevent decorative, `aria-hidden` trailing list content from intercepting a
|
|
30
|
+
whole-row action target, and keep segmented-list item geometry from leaking
|
|
31
|
+
into nested standard lists.
|
|
32
|
+
|
|
33
|
+
Remove unused Material navigation-rail toggle tokens and obsolete list-item
|
|
34
|
+
theme tokens. Register the segmented-button private theme seam and enforce
|
|
35
|
+
token ownership, documentation, removed-name, selector-budget, and cascade
|
|
36
|
+
layer contracts through the component architecture audit.
|
|
37
|
+
|
|
38
|
+
- 4341311: Add reusable fullscreen dialogs and declarative dialog popup mode to `rc-select` and
|
|
39
|
+
`rc-combobox`. Dialog selection and creation are staged until Done, while close and Escape
|
|
40
|
+
discard the draft. Fullscreen surfaces follow the visual viewport under browser zoom and
|
|
41
|
+
software keyboards, and anchored popups now clamp to the visual viewport.
|
|
42
|
+
- 2c7c80a: Give `rc-dialog` a surface styling contract.
|
|
43
|
+
|
|
44
|
+
It exposed only `--rc-dialog-scrim`, so both themes drew the surface by selecting the native
|
|
45
|
+
`<dialog>` directly. It now installs a light-DOM base stylesheet, the same pattern as `rc-button`
|
|
46
|
+
and `rc-disclosure`, and exposes minimum and maximum inline and block bounds, padding, border, radius, background,
|
|
47
|
+
foreground, and shadow, plus fullscreen-specific padding and background for the two values that
|
|
48
|
+
variant genuinely needs of its own.
|
|
49
|
+
|
|
50
|
+
Fullscreen geometry, meaning position, size, margin, radius, and shadow, stays structural rather
|
|
51
|
+
than something a theme sets: filling the visual viewport is what keeps the surface correct under browser zoom
|
|
52
|
+
and a software keyboard.
|
|
53
|
+
|
|
54
|
+
Material's explicit block bound with `overflow: hidden` moved into the base layer rather than
|
|
55
|
+
staying a theme value. It exists because Chromium does not reliably clip a scrolling element's
|
|
56
|
+
own border radius at the scroll boundary, which is a correctness fix every theme needs.
|
|
57
|
+
|
|
58
|
+
`--rc-dialog-visual-viewport-left`, `-top`, `-width`, and `-height` are no longer documented as
|
|
59
|
+
theme properties. They are geometry the component writes while a fullscreen dialog is open:
|
|
60
|
+
readable if something inside the dialog needs the same measurements, but setting them does not
|
|
61
|
+
move the dialog. They are candidates for private `--_rc-dialog-*` names in a future revision.
|
|
62
|
+
|
|
63
|
+
- 4b9bfe6: Give `rc-disclosure` and `rc-accordion` a public styling contract.
|
|
64
|
+
|
|
65
|
+
Both were styled by targeting the native `<details>` element directly, so neither exposed a
|
|
66
|
+
single `--rc-*` property and no theme could change them without rewriting theme CSS. They now
|
|
67
|
+
follow the light-DOM base pattern `rc-button` and `rc-listbox` already use: `rc-disclosure`
|
|
68
|
+
installs one structural stylesheet per containing `Document` or `ShadowRoot`, in `@layer rc-base`
|
|
69
|
+
behind a `data-rc-light-dom-base` sentinel, reading documented properties with UA-like defaults.
|
|
70
|
+
|
|
71
|
+
One recipe covers both supported child forms, a bare `<details>` inside `rc-accordion` and one
|
|
72
|
+
wrapped in `rc-disclosure`, so neither theme repeats the panel rules. `rc-accordion` owns only
|
|
73
|
+
`--rc-accordion-gap`.
|
|
74
|
+
|
|
75
|
+
Motion is opt-in. `--rc-disclosure-duration` defaults to `0ms`, so a disclosure with no theme keeps
|
|
76
|
+
the platform's snap-open behavior, and the height animation runs on `::details-content` behind a
|
|
77
|
+
`@supports selector()` check. This replaces Material's `60rem` `max-block-size` ceiling, which
|
|
78
|
+
clipped content taller than the guess and made every non-summary child its own animation unit.
|
|
79
|
+
|
|
80
|
+
**Fixes a missing expand affordance in the Material theme.** It set `display: grid` on the
|
|
81
|
+
`<summary>` and then styled `summary::marker`. Any `display` other than `list-item` drops the
|
|
82
|
+
marker box, so that rule styled nothing and the theme drew no replacement: a Material disclosure
|
|
83
|
+
had no disclosure triangle at all. The base layer never sets `display` on a summary, so the
|
|
84
|
+
marker survives. A theme may still change it, as Substrate does, but only alongside a
|
|
85
|
+
replacement affordance.
|
|
86
|
+
|
|
87
|
+
- 873592e: Add four directional motion tokens to the shared base contract:
|
|
88
|
+
`--rc-motion-effects-easing-enter`/`-exit` and
|
|
89
|
+
`--rc-motion-spatial-easing-enter`/`-exit`. An opening element decelerates
|
|
90
|
+
into place; a closing one accelerates out. There are no matching enter/exit
|
|
91
|
+
duration tokens; pair `-easing-exit` with an existing `-duration-fast` token
|
|
92
|
+
instead.
|
|
93
|
+
|
|
94
|
+
All three themes map the new tokens: Material pairs them with its
|
|
95
|
+
standard/emphasized decelerate and accelerate curves, Substrate keeps its one
|
|
96
|
+
curve as the enter curve and adds a generic accelerate shape for exit
|
|
97
|
+
(refined further once Substrate gets its own full spatial/effects scale), and
|
|
98
|
+
`rc-theme-win31` declares all four as `step-end`, matching its zero-motion
|
|
99
|
+
contract, so an application that loads the shared base tokens alongside
|
|
100
|
+
`rc-theme-win31` does not inherit the base defaults' real easing curves for
|
|
101
|
+
these two directions.
|
|
102
|
+
|
|
103
|
+
- 7c952e2: `rc-theme-material` and `rc-theme-substrate` refine `prefers-reduced-motion:
|
|
104
|
+
reduce` from removing every transition and animation to removing only
|
|
105
|
+
spatial motion; effects motion (color and opacity) is kept, shortened.
|
|
106
|
+
Vestibular harm, the reason for the preference, comes from movement across
|
|
107
|
+
the visual field; a color or opacity change doesn't trigger it, and removing
|
|
108
|
+
it too was also removing motion that aids comprehension.
|
|
109
|
+
|
|
110
|
+
Material's effects duration shortens to 50/70/100 ms (from its full
|
|
111
|
+
150/200/300 ms scale); Substrate's to 40/55/70 ms, scaled down from
|
|
112
|
+
its own faster 100/160/240 ms base. `rc-theme-win31` needs no change: it
|
|
113
|
+
already declares every duration at zero unconditionally.
|
|
114
|
+
|
|
115
|
+
Several component recipes that bypassed the shared motion scale entirely,
|
|
116
|
+
referencing a raw duration primitive directly, are rewired to the
|
|
117
|
+
appropriate effects or spatial token so this refinement actually reaches
|
|
118
|
+
them: Material's `rc-disclosure`, `rc-list-item`, `rc-bottom-sheet`'s snap
|
|
119
|
+
duration, `rc-button`'s ripple, and its shared state-layer opacity fade;
|
|
120
|
+
Substrate's `rc-listbox`, `rc-splitter`, and `rc-disclosure`. Most land on
|
|
121
|
+
their existing value exactly; `rc-button`'s ripple duration normalizes from
|
|
122
|
+
450 ms to 500 ms, the nearest real spatial tier.
|
|
123
|
+
|
|
124
|
+
- e23a39c: Add an accessible native input and textarea field wrapper with Material 3 filled and outlined
|
|
125
|
+
theme treatments, including an explicit provider contract for enhanced native controls.
|
|
126
|
+
- f5c1a8c: `rc-theme-material` now routes its component motion through the shared
|
|
127
|
+
spatial/effects token scale consistently. Previously, roughly thirty
|
|
128
|
+
`transition`/property declarations across combobox, listbox, menu, menu
|
|
129
|
+
button, menubar, select, range slider, search bar, app bar, textarea,
|
|
130
|
+
transfer list, toolbar, and splitter carried hardcoded `150ms ease` or
|
|
131
|
+
`200ms ease` literals instead of the theme's own motion tokens, and the
|
|
132
|
+
navigation bar/rail's active-item indicator (which resizes to the selected
|
|
133
|
+
item's box, a spatial change) was themed with a raw Material duration/easing
|
|
134
|
+
pair outside either scale. Every color/background-color/border-color/
|
|
135
|
+
box-shadow/opacity transition now uses `--rc-motion-effects-*`, and every
|
|
136
|
+
transform/scale/translate/inline-size/block-size transition uses
|
|
137
|
+
`--rc-motion-spatial-*`, splitting any declaration that mixed both kinds of
|
|
138
|
+
property. `rc-field`'s floating label transition moves its position/size
|
|
139
|
+
properties (`inset-block-start`, `font-size`) from the effects scale to the
|
|
140
|
+
spatial scale they actually belong to.
|
|
141
|
+
|
|
142
|
+
Five component motion tokens the theme previously left unset are now themed:
|
|
143
|
+
`--rc-switch-easing`, `--rc-button-state-layer-duration`,
|
|
144
|
+
`--rc-card-state-layer-duration`, `--rc-card-state-layer-easing`, and
|
|
145
|
+
`--rc-splitter-snap-duration`. `rc-switch`'s single duration/easing pair (it
|
|
146
|
+
has no separate spatial/effects knobs) now takes the spatial scale, since its
|
|
147
|
+
dominant motion, the thumb sliding and resizing, is spatial; this changes its
|
|
148
|
+
default transition speed under this theme from 150 ms to 300 ms.
|
|
149
|
+
`rc-splitter`'s snap-to-point animation moves from its 200 ms component
|
|
150
|
+
default to the same 300 ms spatial-fast tier for the same reason.
|
|
151
|
+
|
|
152
|
+
The spatial easing curves are now sourced from the semantic aliases added in
|
|
153
|
+
the last release rather than composed inline from raw control points four
|
|
154
|
+
times over. Material 3's spec spatial durations are
|
|
155
|
+
350/500/700 ms; this theme's own motion guide finds durations past
|
|
156
|
+
roughly 400 ms read as waiting rather than feedback, so the spatial
|
|
157
|
+
scale is compressed to 300/400/500 ms: a deliberate, recorded departure
|
|
158
|
+
from the spec numbers, not the spec's `emphasized` curve shape, which is
|
|
159
|
+
unchanged.
|
|
160
|
+
|
|
161
|
+
- 40f132d: `rc-theme-material` now declares the Material 3 motion system's seven named
|
|
162
|
+
easing curves (`--md-sys-motion-easing-standard`, `-emphasized`, and their
|
|
163
|
+
decelerate/accelerate variants, plus `-linear`) and sixteen named duration
|
|
164
|
+
bands (`--md-sys-motion-duration-short1` through `-extra-long4`), composed
|
|
165
|
+
from the control points and millisecond primitives already vendored. Several
|
|
166
|
+
component recipes were already reaching for these names with an inline
|
|
167
|
+
fallback (`var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0, 0, 1))`)
|
|
168
|
+
that silently won every time because nothing declared the token; those
|
|
169
|
+
references now resolve for real, and the fallback silently carrying a
|
|
170
|
+
Material 2 curve (`cubic-bezier(0.4, 0, 0.2, 1)`, in `rc-state-layer`'s
|
|
171
|
+
transition) is fixed to the correct Material 3 curve. Two more vendored-token
|
|
172
|
+
gaps of the same shape are fixed alongside: Material's disabled state-layer
|
|
173
|
+
and container opacity tokens, referenced across a dozen component recipes
|
|
174
|
+
with no local declaration, and two Substrate token names
|
|
175
|
+
(`--substrate-border`, `--substrate-radius-medium`) that never matched their
|
|
176
|
+
real declarations (`--substrate-border-color`, `--substrate-radius-md`) and
|
|
177
|
+
so always fell back to a hardcoded literal instead of the theme's actual
|
|
178
|
+
values; `rc-fab-menu`'s Substrate shadow tokens are corrected the same way.
|
|
179
|
+
- 11b8cb9: Theme `rc-select` and `rc-combobox` as `rc-field` control providers: resting, hover, and
|
|
180
|
+
focus/open chrome resets mirroring the existing `rc-textarea` treatment, so `rc-field`'s own
|
|
181
|
+
`#field` surface owns the visible border, background, and focus ring instead of the wrapped
|
|
182
|
+
control rendering its own on top. Standalone (non-wrapped) usage is unaffected; every new rule
|
|
183
|
+
is scoped to `[data-rc-field-control]`.
|
|
184
|
+
|
|
185
|
+
### Patch Changes
|
|
186
|
+
|
|
187
|
+
- 011f3c6: Keep combobox chips clear of their trailing toggle, reset native selects inside
|
|
188
|
+
`rc-field`, keep controlled carousel accessibility state synchronized, and align
|
|
189
|
+
Material chips, menus, lists, disclosures, nested editors, and bottom-sheet
|
|
190
|
+
motion with their MD3 defaults.
|
|
191
|
+
- 114e38a: `rc-progress`'s determinate fill transition is now themeable through two new
|
|
192
|
+
CSS custom properties, `--rc-progress-fill-transition-duration` (default
|
|
193
|
+
`150ms`) and `--rc-progress-fill-transition-easing` (default `ease-out`),
|
|
194
|
+
replacing a hardcoded `0.15s ease-out` no theme could reach.
|
|
195
|
+
|
|
196
|
+
The indeterminate loop's easing changes from `ease-in-out` to `linear`. A
|
|
197
|
+
loop has no beginning or end to decelerate into or accelerate out of, so an
|
|
198
|
+
eased loop visibly pulses at each cycle boundary; Material 3 specifies linear
|
|
199
|
+
easing for indeterminate loops for the same reason.
|
|
200
|
+
|
|
201
|
+
`rc-theme-material` and `rc-theme-substrate` map the new duration/easing
|
|
202
|
+
properties to their effects-fast motion tokens; `rc-theme-win31` already sets
|
|
203
|
+
`transition: none` on the fill part directly and needs no change.
|
|
204
|
+
|
|
205
|
+
- fef89dc: Move the segmented appearance into the component behind one switch.
|
|
206
|
+
|
|
207
|
+
Turning the native fieldset into a segmented control took 27 `--_rc-*`
|
|
208
|
+
declarations that every theme had to restate, 23 of them byte-identical. Two of
|
|
209
|
+
those blocks were accessibility recipes rather than taste: the visually hidden
|
|
210
|
+
legend that keeps the group's accessible name, and the hidden but focusable
|
|
211
|
+
radio. A theme that got either wrong removed the accessible name or made the
|
|
212
|
+
control unreachable by keyboard.
|
|
213
|
+
|
|
214
|
+
The component now owns the recipe and a theme sets
|
|
215
|
+
`--rc-segmented-button-appearance: segmented`. Four genuine theme choices become
|
|
216
|
+
public properties: `--rc-segmented-button-cursor`,
|
|
217
|
+
`--rc-segmented-button-disabled-cursor`,
|
|
218
|
+
`--rc-segmented-button-vertical-divider`, and
|
|
219
|
+
`--rc-segmented-button-selected-icon-display`.
|
|
220
|
+
|
|
221
|
+
Unset, the fieldset, legend, and radios keep their browser appearance, as
|
|
222
|
+
before. The switch is read with a style container query (Chrome 111, Safari 18,
|
|
223
|
+
Firefox 128); where that is unsupported the recipe does not apply and the
|
|
224
|
+
control falls back to the same native appearance.
|
|
225
|
+
|
|
226
|
+
To migrate a theme, replace its `--_rc-segmented-button-*` block with the single
|
|
227
|
+
`--rc-segmented-button-appearance: segmented` declaration, plus any of the four
|
|
228
|
+
public properties whose value differs from the default.
|
|
229
|
+
|
|
230
|
+
- 77f9c63: Fix three theme gaps where a token fell through to a system color.
|
|
231
|
+
|
|
232
|
+
**Substrate had no error color.** `--rc-field-error-color` fell through to `rc-field`'s own
|
|
233
|
+
default of `Mark`, the system color for the background of highlighted text, which renders as
|
|
234
|
+
pure yellow and measured 1.07:1 against the field. Validation worked, the message was in the
|
|
235
|
+
accessibility tree, and it could not be read. Substrate now ships `--substrate-error`, held
|
|
236
|
+
at hue 25 so it reads as red rather than as a darker shade of the orange primary at hue 48,
|
|
237
|
+
and the bridge maps it. Both modes clear 7:1.
|
|
238
|
+
|
|
239
|
+
Every remaining error fallback of `Mark`, in `rc-field` and in the Material field styles, now
|
|
240
|
+
falls back to the validation red a user agent uses for an invalid control. The `Mark` usages
|
|
241
|
+
inside `forced-colors` blocks are unchanged, where a system color is correct.
|
|
242
|
+
|
|
243
|
+
**Material never set `--rc-button-text`.** `rc-select`, `rc-combobox`, and `rc-menu-button`
|
|
244
|
+
read it directly for text drawn over `--rc-button-bg`, which Material sets to the primary
|
|
245
|
+
fill, so the `ButtonText` fallback gave 3.26:1 in light and 1.70:1 in dark. It now follows
|
|
246
|
+
`--md-sys-color-on-primary` alongside `--rc-button-color`, giving 6.44:1 and 7.71:1.
|
|
247
|
+
|
|
248
|
+
**Substrate referenced three tokens it never declared.** `--substrate-inverse-surface`,
|
|
249
|
+
`--substrate-inverse-on-surface`, and `--substrate-radius-pill` were used by the bridge and
|
|
250
|
+
component styles but missing from `defaults.css`, leaving `rc-snackbar` on system colors and
|
|
251
|
+
the bottom sheet handle on a literal. All three are declared, and a `defaults` test now
|
|
252
|
+
asserts that every referenced token exists.
|
|
253
|
+
|
|
254
|
+
- 1aff823: Document icon font wiring as one copy-pasteable rule.
|
|
255
|
+
|
|
256
|
+
The theme sizes icon markers but sets no `font-family`, so a marker without one
|
|
257
|
+
renders as its literal text. That was documented per component, which meant
|
|
258
|
+
adopting a component could reintroduce the problem one marker at a time. The
|
|
259
|
+
README now lists every marker in the catalog in a single rule, and names the
|
|
260
|
+
three that carry no sizing from the theme either.
|
|
261
|
+
|
|
262
|
+
- 3a5d979: Restore a multiline control-provider field's top spacing so its label sits as
|
|
263
|
+
far below the field's top edge as a single-line field's label does. A
|
|
264
|
+
single-line field gets that space for free from centering content within a
|
|
265
|
+
taller field surface; a multiline control-provider's content fills the
|
|
266
|
+
surface's whole height instead, so the label sat flush against the top edge
|
|
267
|
+
with no room above it.
|
|
268
|
+
- 4457e71: Fix two token generator defects that produced plausible but wrong output.
|
|
269
|
+
|
|
270
|
+
A font shorthand read as a single number. `var(--weight, 500) var(--size, 1rem) / var(--lh)
|
|
271
|
+
var(--family)` both starts and ends with `var(`, and the anchored pattern's fallback group is
|
|
272
|
+
greedy, so it matched as one `var(--weight)` whose fallback was the rest of the declaration and
|
|
273
|
+
resolved to `500`. The export carried `card/title-font` and `card/subtitle-font` as floats that
|
|
274
|
+
were really a collapsed shorthand. A value now counts as an alias only when its opening `var(`
|
|
275
|
+
closes at the end of the string.
|
|
276
|
+
|
|
277
|
+
A mix weight written as a `calc` only worked by accident. Material writes its state layers as
|
|
278
|
+
`color-mix(in srgb, var(--color) calc(var(--opacity, 0.08) * 100%), transparent)`. The old code
|
|
279
|
+
pattern-matched a trailing percentage off the operand, leaving a malformed remainder that
|
|
280
|
+
happened to resolve through the greedy match above. Mix operands are now split at parenthesis
|
|
281
|
+
depth zero and the weight resolves through the same resolver.
|
|
282
|
+
|
|
283
|
+
## 0.6.0
|
|
284
|
+
|
|
285
|
+
### Minor Changes
|
|
286
|
+
|
|
287
|
+
- ffcbf11: Add adaptive chip-group layouts, native-backed filter chips, and shared
|
|
288
|
+
input-chip rendering. Native-backed chips preserve controlled host state,
|
|
289
|
+
follow form resets when uncontrolled, and accept native link actions. Groups
|
|
290
|
+
restore author-owned chip variants when coordination ends. Keep search input
|
|
291
|
+
chrome inside the search surface and align contextual icon sizes with Material 3.
|
|
292
|
+
- 40f9776: Add an APG carousel built on native CSS scroll snap, with optional navigation,
|
|
293
|
+
pagination, mouse dragging, looping, and consumer-controlled slide sizing.
|
|
294
|
+
Preserve controlled active-index behavior after rejected swipes, keep visual
|
|
295
|
+
loop clones inert and out of forms, and degrade safely without intersection
|
|
296
|
+
observation.
|
|
297
|
+
- a108336: Add shared-column `rc-list` and `rc-list-item` elements with standard and
|
|
298
|
+
segmented appearances, default content truncation, and native-backed single or
|
|
299
|
+
multiple selection coordination. Restore author-owned item state when native
|
|
300
|
+
selection coordination ends.
|
|
301
|
+
- 509ee64: Add `rc-progress`, a native `<progress>` enhancer with a formatted value
|
|
302
|
+
display, a track and fill you can restyle with CSS custom properties, and a
|
|
303
|
+
built-in fix for the indeterminate/undefined-binding footgun.
|
|
304
|
+
|
|
305
|
+
Keep the native element as the uncontrolled source of truth, support releasing
|
|
306
|
+
a controlled value, and react to live native `value`/`max` changes. Preserve a
|
|
307
|
+
native determinate value while `indeterminate` temporarily removes its
|
|
308
|
+
attribute.
|
|
309
|
+
|
|
310
|
+
The bar renders at its intended height with no `display` attribute set,
|
|
311
|
+
matching its own documented default: previously the track/fill/native
|
|
312
|
+
`<progress>` are all absolutely positioned, contributing nothing to the
|
|
313
|
+
control's normal-flow height, so with no value-display text sharing its grid
|
|
314
|
+
row to give it one, the whole bar collapsed to 0px.
|
|
315
|
+
|
|
316
|
+
- d67efde: Add a native-host scroll region with optional centered content and fullbleed
|
|
317
|
+
layout tracks, aggregate framework typings, RTL-aware boundary state, and
|
|
318
|
+
Material layout defaults.
|
|
319
|
+
- 6d3b478: Add Material button emphasis, danger-tone, icon sizing, and adaptive-menu
|
|
320
|
+
contracts. Complete the bundled surface-role palette and forced-colors mappings.
|
|
321
|
+
- 30eb232: Add icon-only activation-area sizing and Material icon-button variants. Align menu
|
|
322
|
+
selection and submenu affordances, and keep anchored popups within the viewport
|
|
323
|
+
across native and fallback positioning.
|
|
324
|
+
- 6d3b478: Default the new touch-target overlap tokens for MD3's own dense/narrow
|
|
325
|
+
icon-button and overflow-trigger conventions: `rc-button`'s and
|
|
326
|
+
`rc-menu-button`'s narrow variant (where the icon is smaller than the
|
|
327
|
+
default 3rem touch target) now reclaim the trailing edge automatically,
|
|
328
|
+
and `rc-adaptive-menu`'s overflow trigger, always the trailing-most
|
|
329
|
+
control in its toolbar by design, does the same unconditionally. Only the
|
|
330
|
+
trailing edge defaults, matching each component's own documented
|
|
331
|
+
"trailing overflow trigger" use case; the leading edge stays an explicit
|
|
332
|
+
opt-in.
|
|
333
|
+
|
|
334
|
+
### Patch Changes
|
|
335
|
+
|
|
336
|
+
- 6d3b478: Keep generic dialog button styles out of custom control wrappers, support nested
|
|
337
|
+
bottom-sheet handles, and expose the Material disabled-button opacity token.
|
|
338
|
+
|
|
339
|
+
## 0.5.0
|
|
340
|
+
|
|
341
|
+
## 0.4.2
|
|
342
|
+
|
|
343
|
+
## 0.4.1
|
|
344
|
+
|
|
345
|
+
## 0.4.0
|
|
346
|
+
|
|
347
|
+
### Minor Changes
|
|
348
|
+
|
|
349
|
+
- e57277f: Add Material 3 search-view, fixed-pane splitter, dialog scrim, and resize enhancements.
|
|
350
|
+
|
|
351
|
+
`rc-search-bar` now supports `variant="view"`, controlled/default open state, search-view methods, a rich `suggestions` slot, and datalist-derived text suggestions. `rc-splitter` adds `mode="fixed"` for clampable pixel primary panes. `rc-common` now honors CSS max-size constraints during resize gestures, and `rc-dialog` exposes a scrim token plus resize handle/origin hooks used by themed surfaces.
|
|
352
|
+
|
|
353
|
+
- c40a1be: Add theme-neutral fast, default, and slow effects and spatial motion token
|
|
354
|
+
pairs. Expose bottom-sheet settle easing through
|
|
355
|
+
`--rc-bottom-sheet-snap-easing` and map sheet settling to the Material spatial
|
|
356
|
+
motion scheme.
|
|
357
|
+
|
|
358
|
+
Give direct-child bottom-sheet handles a full-width 48px interaction target
|
|
359
|
+
while preserving the 32 by 4 pixel visual indicator. Replace rectangular
|
|
360
|
+
mobile browser tap highlights on chips with themeable, shape-clipped state
|
|
361
|
+
layers. Keep bottom-sheet snap targets docked to the block-end edge when CSS
|
|
362
|
+
minimum or maximum sizing constrains their requested heights.
|
|
363
|
+
|
|
364
|
+
Mount declaratively assigned textarea plugins at connection time and remount
|
|
365
|
+
them after reconnection, preserving plugin effects and adopted styles in
|
|
366
|
+
framework render lifecycles.
|
|
367
|
+
|
|
368
|
+
### Patch Changes
|
|
369
|
+
|
|
370
|
+
- 9c7476d: Add theme-specific rc-button progress treatments, including compact Material spinners and
|
|
371
|
+
Substrate percentage indicators.
|
|
372
|
+
- 3efe74a: Center navigation rail header content on the inline axis and remove Material
|
|
373
|
+
elevation from FABs placed in the header slot.
|
|
374
|
+
- ebec800: Dock bottom sheets without a theme to the viewport block-end by default and
|
|
375
|
+
support absolute positioning for non-modal sheets contained by a positioned ancestor.
|
|
376
|
+
Center authored drag handles with a splitter-aligned pill treatment. Align the
|
|
377
|
+
Material theme with its surface, elevation, scrim, drag-handle, and contextual
|
|
378
|
+
button treatment.
|
|
379
|
+
- e88eff8: Refine semantic card-title typography and icon-button alignment across both
|
|
380
|
+
themes. Simplify Substrate navigation selection, match its bottom-sheet handle
|
|
381
|
+
to the splitter grip, improve inverse notification action contrast, and theme the
|
|
382
|
+
Markdown editor's composed controls.
|
|
383
|
+
- 6f91e7a: Fix collapsed `rc-navigation-rail` items so the whole item's box wraps icon and
|
|
384
|
+
label, not just the icon. The shared component pulled the label out of flow
|
|
385
|
+
(`position: absolute`), so a theme's whole-item background or focus ring only
|
|
386
|
+
covered the icon; Material's detached-pill layout now lives in its own theme
|
|
387
|
+
stylesheet instead of the shared base. Substrate's collapsed rail also grows
|
|
388
|
+
from `5rem` to `6rem` so single-word labels like "Settings" stop wrapping.
|
|
389
|
+
- dce5749: Replace the navigation rail's shadow-DOM fallback toggle with a consumer-authored light-DOM
|
|
390
|
+
button, and align collapsed and expanded item layouts across the default and reference themes.
|
|
391
|
+
- 55e8ab5: Preserve UA-like control and surface styling until an optional theme supplies decorative tokens.
|
|
392
|
+
Restore themed button hover and pressed state layers, including a pointer-origin Material ripple.
|
|
393
|
+
- 4d118ff: Share icon-font size and line-height tokens across themed component icon markers.
|
|
394
|
+
- 3e89095: Replace rc-menu's generated submenu glyph with an author-supplied `indicator`
|
|
395
|
+
slot on rc-menu-button. Keep the decorative indicator inside the trigger bounds,
|
|
396
|
+
reserve label space for it, and expose theme-neutral size, color, and inset
|
|
397
|
+
tokens for Material, Substrate, and application themes.
|
|
398
|
+
- 0dd9ff5: Prevent Material switches from collapsing below their 52 by 32 pixel track geometry in constrained flex and grid layouts.
|
|
399
|
+
- 979b989: Use a zero default gap for tighter chip content layout and a smaller default
|
|
400
|
+
font size for slotted remove icons. Derive removable content padding from the
|
|
401
|
+
remove target width and chip gap so the label and trailing icon stay aligned.
|
|
402
|
+
|
|
403
|
+
## 0.3.2
|
|
404
|
+
|
|
405
|
+
## 0.3.1
|
|
406
|
+
|
|
407
|
+
## 0.3.0
|
|
408
|
+
|
|
409
|
+
### Added
|
|
410
|
+
|
|
411
|
+
- Add full Material 3 token support.
|
|
412
|
+
- Add Material styling for the FAB back-to-top pattern.
|
|
413
|
+
- Add Material styling for the splitter collapse handle.
|
|
414
|
+
|
|
415
|
+
### Changed
|
|
416
|
+
|
|
417
|
+
- Normalize listbox, menu, menu-button, and menubar styling through inherited component tokens.
|
|
418
|
+
- Update search-bar elevation, hover, and keyboard-focus styling.
|
|
419
|
+
- Update rc-select selectors for the default native select slot.
|
|
420
|
+
- Update transfer-list listbox backgrounds and action button corner radius.
|
|
421
|
+
- Update package metadata, README intro, and docs links.
|
|
422
|
+
|
|
423
|
+
## 0.2.0
|
package/README.md
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# `@rcarls/rc-theme-material`
|
|
2
|
+
|
|
3
|
+
[Material 3](https://m3.material.io/) CSS theme and token bridge for `rc-webcomponents`.
|
|
4
|
+
|
|
5
|
+
Docs: [https://richardcarls.github.io/rc-webcomponents/guide/theme-previews](https://richardcarls.github.io/rc-webcomponents/guide/theme-previews).
|
|
6
|
+
|
|
7
|
+
Maps Material Design system and component CSS custom properties onto the
|
|
8
|
+
public `--rc-*` styling contract. It changes presentation only and is an
|
|
9
|
+
entirely optional theme package.
|
|
10
|
+
|
|
11
|
+
Material 3 tokens and defaults vendored from the archived
|
|
12
|
+
[material-foundation/material-tokens](https://github.com/material-foundation/material-tokens)
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
yarn add @rcarls/rc-theme-material
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Bridge your existing Material 3 theme
|
|
21
|
+
|
|
22
|
+
Import the design-token bridge and `rc-webcomponents` styles.
|
|
23
|
+
|
|
24
|
+
```css
|
|
25
|
+
@import '@rcarls/rc-theme-material/bridge.css';
|
|
26
|
+
@import '@rcarls/rc-theme-material/components.css';
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Selective component styles are also exported:
|
|
30
|
+
|
|
31
|
+
```css
|
|
32
|
+
@import '@rcarls/rc-theme-material/bridge.css';
|
|
33
|
+
@import '@rcarls/rc-theme-material/components/select.css';
|
|
34
|
+
@import '@rcarls/rc-theme-material/components/menu.css';
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The state-layer utility is included by `components.css` and `theme.css`, and is
|
|
38
|
+
also exported separately for selective imports:
|
|
39
|
+
|
|
40
|
+
```css
|
|
41
|
+
@import '@rcarls/rc-theme-material/state-layer.css';
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Apply `.rc-state-layer` to interactive elements that already define their own
|
|
45
|
+
border radius when you want a CSS-only Material state layer.
|
|
46
|
+
|
|
47
|
+
Theme styles are scoped under a `.rc-theme-material` class.
|
|
48
|
+
|
|
49
|
+
```html
|
|
50
|
+
<body class="rc-theme-material">
|
|
51
|
+
<!-- rc-webcomponents -->
|
|
52
|
+
</body>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Button variants and tones
|
|
56
|
+
|
|
57
|
+
The default `rc-button` treatment is filled. Use `rc-button--tonal`,
|
|
58
|
+
`rc-button--outlined`, or `rc-button--text` for the other Material emphasis
|
|
59
|
+
levels. Icon-only buttons use `rc-icon-button--standard`,
|
|
60
|
+
`rc-icon-button--tonal`, or `rc-icon-button--outlined`.
|
|
61
|
+
|
|
62
|
+
`rc-field` uses the Material 3 filled text-field treatment by default. Add
|
|
63
|
+
`rc-field--outlined` for the outlined variant.
|
|
64
|
+
|
|
65
|
+
Add `data-tone="danger"` to any of those variants for the corresponding error
|
|
66
|
+
or error-container color roles. These classes and data attributes are theme
|
|
67
|
+
hooks; they do not change the component's native-button behavior or public API.
|
|
68
|
+
|
|
69
|
+
```html
|
|
70
|
+
<rc-button class="rc-button--tonal">
|
|
71
|
+
<button type="button">Save draft</button>
|
|
72
|
+
</rc-button>
|
|
73
|
+
|
|
74
|
+
<rc-button class="rc-button--outlined" data-tone="danger">
|
|
75
|
+
<button type="button">Delete</button>
|
|
76
|
+
</rc-button>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Full standalone Material 3 theme
|
|
80
|
+
|
|
81
|
+
Includes bundled light and dark Material 3 token defaults and the full
|
|
82
|
+
bridge and component style layers:
|
|
83
|
+
|
|
84
|
+
```css
|
|
85
|
+
@import '@rcarls/rc-theme-material/theme.css';
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Theming scope
|
|
89
|
+
|
|
90
|
+
The full style layer styles native controls when their intent is established by
|
|
91
|
+
composition, for example menu items and button triggers. Otherwise, it does not style
|
|
92
|
+
unrelated application controls and follows design-token conventions.
|
|
93
|
+
|
|
94
|
+
Fonts and icons are not bundled; websites and applications may provide
|
|
95
|
+
[Roboto](https://fonts.google.com/specimen/Roboto) and
|
|
96
|
+
[Material Symbols](https://fonts.google.com/icons) through other means.
|
|
97
|
+
|
|
98
|
+
### Icon font wiring
|
|
99
|
+
|
|
100
|
+
The theme sizes and centers icon markers but never sets `font-family` on them,
|
|
101
|
+
because no font ships with it. Until the application supplies one, an icon
|
|
102
|
+
marker renders as its literal text, so a navigation toggle shows the word
|
|
103
|
+
`menu` rather than a glyph.
|
|
104
|
+
|
|
105
|
+
Every marker in the catalog needs that one declaration. Wire them all at once
|
|
106
|
+
rather than adding each as you adopt the component it belongs to:
|
|
107
|
+
|
|
108
|
+
```css
|
|
109
|
+
:is(
|
|
110
|
+
[data-rc-icon],
|
|
111
|
+
[data-rc-button-icon],
|
|
112
|
+
[data-rc-button-selected-icon],
|
|
113
|
+
[data-rc-chip-icon],
|
|
114
|
+
[data-rc-menu-icon],
|
|
115
|
+
[data-rc-navigation-icon],
|
|
116
|
+
[data-rc-navigation-collapse-icon],
|
|
117
|
+
[data-rc-navigation-expand-icon],
|
|
118
|
+
[data-rc-segmented-button-selected-icon]
|
|
119
|
+
) {
|
|
120
|
+
font-family: 'Material Symbols Outlined';
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Three of those carry no sizing from the theme, so give them a `font-size`
|
|
125
|
+
alongside the font where an application uses them:
|
|
126
|
+
`data-rc-navigation-collapse-icon`, `data-rc-navigation-expand-icon`, and
|
|
127
|
+
`data-rc-segmented-button-selected-icon`.
|
|
128
|
+
|
|
129
|
+
For the rest, the shared `--rc-icon-font-size` and `--rc-icon-font-line-height`
|
|
130
|
+
tokens keep glyph geometry consistent and can be overridden at the theme
|
|
131
|
+
boundary or on one component.
|
|
132
|
+
|
|
133
|
+
### Icon-button modifiers
|
|
134
|
+
|
|
135
|
+
Apply these classes to `rc-button[icon-only]` to use the Material 3 expressive
|
|
136
|
+
container and icon sizes. The default, unmodified size is small: a `2.5rem`
|
|
137
|
+
container with a `1.5rem` icon.
|
|
138
|
+
|
|
139
|
+
| Class | Container | Icon |
|
|
140
|
+
| ------------------------ | --------: | --------: |
|
|
141
|
+
| `rc-button--extra-small` | `2rem` | `1.25rem` |
|
|
142
|
+
| `rc-button--medium` | `3.5rem` | `1.5rem` |
|
|
143
|
+
| `rc-button--large` | `6rem` | `2rem` |
|
|
144
|
+
| `rc-button--extra-large` | `8.5rem` | `2.5rem` |
|
|
145
|
+
|
|
146
|
+
Combine a size class with `rc-button--narrow` or `rc-button--wide` to select
|
|
147
|
+
that size's narrower or wider container width without changing its height or
|
|
148
|
+
icon size. `rc-menu-button[icon-only]` supports `rc-menu-button--narrow` for a
|
|
149
|
+
`2rem`-wide small trigger. The component packages continue to reserve a `3rem`
|
|
150
|
+
activation area around visual containers smaller than that target.
|
|
151
|
+
|
|
152
|
+
`rc-adaptive-menu` uses the same Material small narrow geometry for its
|
|
153
|
+
overflow trigger: a `2rem × 2.5rem` visible container centered in the
|
|
154
|
+
component-owned `3rem × 3rem` activation area. The theme also aligns overflow
|
|
155
|
+
rows with Material menu geometry while leaving the component's controlled or
|
|
156
|
+
uncontrolled `open` contract unchanged.
|
|
157
|
+
|
|
158
|
+
Direct native buttons in an `rc-app-bar`'s `leading` and `trailing` slots also
|
|
159
|
+
receive the Material small icon-button geometry. Controls nested in an
|
|
160
|
+
`rc-button` or `rc-menu-button` keep their component-owned sizing.
|
|
161
|
+
|
|
162
|
+
[Material Web](material-web.dev) token names are used where a corresponding component
|
|
163
|
+
exists. Search bar and top app bar mappings follow Material 3 token terminology and
|
|
164
|
+
fall back through Material system roles.
|