No.203 · FAQ· New
Colour Register FAQ
Every question keeps its own colour: a small register becomes the open answer surface, so the FAQ reads like a carefully filed set.
The prompt
The design brief behind this component — reuse it to regenerate, remix, or explain it.
Build a colour-indexed accordion on pale paper. Each stable-ID question owns one of five preset treatments: mint, lilac, blue, peach or butter. Closed, the row has a small vertical colour register beside a mono number, a medium-weight Geist question and a plus icon. Open, that same colour fills the entire row and answer surface, the register shortens and the plus becomes a minus. One answer may be open; activating it again closes all. Reveal content using a 0fr to 1fr grid transition over 320ms, without measuring content height. Accept arbitrary React-node answers, including links and long paragraphs. Link each heading button to its answer region with unique per-instance IDs; closed regions must be inert, aria-hidden and visually hidden. Arrow Up/Down and Home/End move among question buttons; Enter/Space activate normally. On a phone reduce padding while preserving number, wrapped question and icon alignment. Reduced motion changes all states immediately. Identity colour never substitutes for expanded state or a visible focus ring. Implementation requirements: Use React and TypeScript. Keep the component self-contained, with uniquely scoped CSS and no animation libraries. Include required imports, styles and font setup in the result. Interaction: Open one answer or close all. Arrow Up/Down and Home/End move focus without changing the open answer. Motion: 320ms grid-row expansion, colour fill and plus rotation; reduced motion is immediate. Accessibility: Semantic headings and native links/buttons, visible focus, decorative geometry hidden from assistive technology. Independent instances; honour reduced motion. Responsive behavior: Fluid layout and wrapping text at 320px through desktop. Page compositions stack intentionally on narrow screens; recovery links remain visible. Touch: Normal taps activate all actions. Pointer-only decoration is optional and fixed on touch. Preserve keyboard access, visible focus and reduced-motion behavior. Keep fictional demo data and simulated service calls in a separate usage example; expose callbacks for real actions and recover from rejected requests. Keep usage-example links inside the demo: use local buttons or prevent navigation. Demonstration links must not navigate to Vitrine routes or open other pages; preserve real URL support in the reusable component itself. Verify the result at narrow and wide viewport sizes, with keyboard input and reduced motion enabled.
Notes
- Interaction
- Open one answer or close all. Arrow Up/Down and Home/End move focus without changing the open answer.
- Motion
- 320ms grid-row expansion, colour fill and plus rotation; reduced motion is immediate.
- Accessibility
- Semantic headings and native links/buttons, visible focus, decorative geometry hidden from assistive technology. Independent instances; honour reduced motion.
- Responsive
- Fluid layout and wrapping text at 320px through desktop. Page compositions stack intentionally on narrow screens; recovery links remain visible.
- On touch
- Normal taps activate all actions. Pointer-only decoration is optional and fixed on touch.