CSS only menu toggle - is this a good way to approach it?
For years I've used jQuery slideUp/Down/Toggle() for showing menus on mobile devices. However, recently I've started using :has selectors more and that's opening up the possibility to do CSS-only versions:
- My menu toggle button becomes a
label
label
containing a checkbox (hidden). When you click the label, it checks the checkbox
Is this a good way to approach it, or should I stick to some javascript anyway as I should be setting aria-expanded etc (which could also drive the CSS)?