Task List That Styles Itself with the CSS :has() Selector

A to-do list where checking an item restyles its whole row - background, strikethrough, a checkmark - using only the CSS :has() parent selector (.has-task:has(input:checked)). No JavaScript at all: it also uses a CSS counter (counter-increment on the same :has() rule) to keep a live 'X of 5 tasks done' summary in sync, and an @supports not selector(:has(a)) feature query to show a graceful fallback note in browsers that don't support :has() yet.




Related snippets :

Infinite Auto-Scroll Marquee (Pure CSS, No Java...


Dark Mode Toggle with CSS Variables & LocalStor...


Skeleton Loading Shimmer Effect (Pure CSS)


Responsive Card Grid with CSS Grid (No Media Qu...