:has() — the missing selector
Style any ancestor based on its children's state. Form labels highlight on input focus — no JavaScript, no state management, pure CSS.
Without
Without
With
Esc to return · ← → to navigate
Style any ancestor based on its children's state. Form labels highlight on input focus — no JavaScript, no state management, pure CSS.
Esc to return · ← → to navigate