Step wizard
Three steps with Back and Next buttons, a step list you can click, and aria-current on the current step.
One keyword state cycles through three themes, and the page colors and the button label follow it.
Click the Theme button several times.
| name | value | previous | changes |
|---|---|---|---|
| Waiting for the preview to start. | |||
A keyword state with more than two values. cycle() moves to the next keyword and wraps at the end; :when() rules pick the colors, and content writes the theme’s name into the button.
prefers-color-scheme follows the system setting, and color-scheme with light-dark() picks colors from it. CSS alone cannot let the reader choose a theme on the page.
persist("theme") to the state for that; it cannot store anything inside this sandboxed preview./* ---- Reactive CSS -------------------------------------------------------------------------- */.themes { --theme: state(light); }.themes .switch:on(click) { --theme: cycle(light, dark, sepia); }.themes:when(--theme == dark) { background: #1c1917; color: #f5f5f4; }.themes:when(--theme == sepia) { background: #f3e7d0; color: #3f2d1c; }/* The button names the current theme, as real DOM text. */.themes .name { content: var(--theme); }Source: site/src/catalog/interfaces/theme-switcher/. style.css from its Reactive CSS divider; the layout above it and the shared api.css run but are not shown.
Three steps with Back and Next buttons, a step list you can click, and aria-current on the current step.
Native checkboxes whose label fades when done, with a short animation when a task is checked or unchecked.
A billing switch changes the price and shows the annual saving, with role="switch" kept in sync.