4 ms·
The checkbox hack can be replaced with :active in many cases.
by emptyparadise 5y ago
The checkbox hack can be replaced with :active in many cases.
- chrismorgan 5y ago:active is completely different and never a suitable replacement for the checkbox hack: it only ever matches while the primary mouse button is being held down, and is keyboard-inaccessible; the checkbox hack is about toggling state on click or key stroke.
- emptyparadise 5y agoOops, I meant :target.
- chrismorgan 5y ago:target is dubious at best: it messes with your scroll position, and you can only use it for one thing in a document. Historically it was also rather buggy in most browsers, though hopefully that’s sorted out now. (A decade ago, Firefox was fine, but IE and Chromium both had significant bugs, might have been to do with back/forward not recalculating :target or something like that. When I last seriously used :target in 2016 or so, on a multipage-in-one-document résumé, I think they were down to fairly minor bugs.)