Imperator Design
The library

Techniques, not templates

Every trick recreated from the source video as a live, self-contained demo. Search, filter, open, steal.

1 / 1

Cards That Restyle Themselves with :has()

A parent cannot normally react to its own children, which is why this pattern used to need JavaScript. :has() turns the relationship around: label:has(:checked) styles the whole card from the state of the input inside it. One selector, no classes to toggle, no listeners — CSS reading its own subtree like an if-statement.

cssformsinteraction:hascheckboxselectors