About this set
Two to-do lists that do in CSS what most to-do lists need JavaScript for. Garden weekend has All, To do and Done filters built from a radio group: a :has() rule on the card reads the checked filter and hides the rows that do not match, and empty-state messages such as Everything on this list is done appear the same way. A footer reads 3 to do and 2 done from CSS counters. Filtered rows are collapsed with visibility hidden and zero height instead of display none, because CSS counters skip elements that are not displayed, so the counts stay right whichever filter is on, and an All finished note appears when every box is ticked. Book club at mine pairs native checkboxes coloured with accent-color with a Hide completed switch that hides ticked rows through :has(), and a notes field that grows with its content through field-sizing: content, between three and ten lines. Nothing in the set uses JavaScript, so nothing is saved and nothing can be added; the set shows how far filtering, counting and empty states can go with CSS alone.
What’s included
- All, To do and Done filters from a radio group and :has(), no JavaScript
- Counts from CSS counters that survive filtering
- Empty states and an all-done note shown with :has()
- Hide completed switch and native accent-color checkboxes
- Notes field that grows with field-sizing: content
Accessibility
The filters are native radio buttons in a fieldset with a Show tasks legend, the hide switch is a checkbox with role="switch", and every task is a real checkbox with a label. Filtered rows use visibility hidden, so they leave the tab order and the accessibility tree. The counts are CSS generated content, which current browsers expose to screen readers, but there is no script, so changes are not announced. Every control shows a visible focus outline, and transitions stop under prefers-reduced-motion.
Customise it
Change --mc-accent, --mc-accent-dark, --mc-tint and --mc-box on .mc; accent-color follows --mc-accent. Bootstrap uses the same variables on .btn-check, .form-switch and .form-check-input; in Tailwind swap the #4338ca and #eceefc utilities.





