Variants
Sizes and states, all built from the same markup.
Usage
Paste the markup, include assets/css/tokens.css and assets/css/tailwind.css, then run the script from this page.
Accessibility
- Role and state. A real radiogroup of buttons with role="radio" and aria-checked. The live region announces the colour picked.
- Keyboard. One tab stop. Arrow keys move and select, Home and End jump to the ends. The focus ring uses the --ring token.
- Reduced motion. With prefers-reduced-motion the jug changes colour instantly, with no falling paint, drips, shake or camera moves.
- No WebGL. Without WebGL the stage falls back to a glow and the swatches still select and announce the colour.