4 ms·
I’ve written a tutorial on building one of these that uses a checkbox. There’s more ways than a button or a link. Some people have suggested in the comments us
by DitheringIdiot 4y ago
I’ve written a tutorial on building one of these that uses a checkbox.
There’s more ways than a button or a link. Some people have suggested in the comments using details and summary.
It works without javascript, represents the states open and closed without requiring any aria attributes and some other usability features people might find interesting.
https://endtimes.dev/html-and-css-only-multiple-color-scheme-picker/ https://endtimes.dev/html-and-css-only-multiple-color-scheme...
- datagram 4y agoGitHub uses <details> for most of their dropdowns and it does generally work well, though you'll run into issues if you ever need to break out of the DOM hierarchy (for example, to have the popup overflow a scrollable container).