4 ms·
Nothing pre-built, but you can cobble something together yourself – query the DOM for stylesheets, evaluate their attributes (i.e. especially the "title" and "a
by iggldiggl 5y ago
Nothing pre-built, but you can cobble something together yourself – query the DOM for stylesheets, evaluate their attributes (i.e. especially the "title" and "alternate" attributes) and then enable and disable them as required.
I wrote something like that for my homepage, although as I only needed to switch between two styles and I'm not a front-end person, I didn't bother with an actual selection drop-down and just wrote a toggle that cycles through all alternate stylesheets one at a time.
- toastal 5y agoThis works pretty nicely if they only refer to which CSS variables to load and the main CSS file is waiting to be overridden by these variables. I just wish it got a higher priority by browsers to have good built-ins.