Theme switcher
One keyword state cycles through three themes, and the page colors and the button label follow it.
Each item opens and closes on its own, and its button reports the state with aria-expanded.
Click a question, or focus it with Tab and press Enter or Space.
| name | value | previous | changes |
|---|---|---|---|
| Waiting for the preview to start. | |||
State ownership. --open is declared on .item, so every item has its own copy: a click on one button toggles only the state of the item around it.
<details> and <summary> give an accordion with no script and the right semantics, and <details name="faq"> makes it exclusive. Prefer them when nothing else on the page needs to know which item is open; this version shows how state stays per item.
display: none, so the browser’s find-in-page does not open them, unlike <details>./* ---- Reactive CSS -------------------------------------------------------------------------- *//* Each item owns its own state: opening one leaves the others as they are. */.faq .item { --open: state(false); }.faq .item > button:on(click) { --open: toggle(); }.faq .item > button { --attr-aria-expanded: var(--open); }.faq .item:when(--open) .body { display: block; }.faq .item .chevron { rotate: when(--open, 180deg, 0deg); }Source: site/src/catalog/interfaces/accordion/. style.css from its Reactive CSS divider; the layout above it and the shared api.css run but are not shown.
One keyword state cycles through three themes, and the page colors and the button label follow it.
A text field, a select and a checkbox feed a live preview, and Reset clears both.
Three steps with Back and Next buttons, a step list you can click, and aria-current on the current step.