color-mix(), without swapping any classes.
contrast-color() chooses black or white text for it. The swatches are radio buttons read with :has().
contrast-color().
contrast-color().
Demos 1 to 8 all use the same trick. A range slider's thumb gets a view-timeline, a registered @property is tied to it, and dragging the slider scrubs that value live. They need a Chromium browser. Demos 9 to 11 use :has(), @keyframes and contrast-color() instead, and need a very recent browser (Chrome 147+, Firefox 146+, Safari 26+). There's no JavaScript in any of them, and a note on the source article is in docs/.
color-mix(), without swapping any classes.
contrast-color() chooses black or white text for it. The swatches are radio buttons read with :has().
contrast-color().
contrast-color().