Post 9pudI3ZSqufKfRSNA8 by kelly_clowers@mastodon.technology
 (DIR) More posts by kelly_clowers@mastodon.technology
 (DIR) Post #9ptWigtwLuRxL8pLo8 by easthighNerd@niu.moe
       2019-12-12T16:45:22Z
       
       0 likes, 0 repeats
       
       Does anyone know if there is a way (purely in CSS/HTML (no JavaScript)) that, for example, one could switch between a light and a dark theme on a website?
       
 (DIR) Post #9ptXv0tvv2RAnWGPY0 by namwen@niu.moe
       2019-12-12T16:58:49Z
       
       0 likes, 0 repeats
       
       @easthighNerd if you're not just serving static files, I typically load an alternate stylesheet that is enabled server-side that replaces the default "light" file.Not sure about if the site is static though
       
 (DIR) Post #9ptYLgDwu7dEUHLEjw by kiito@niu.moe
       2019-12-12T17:03:38Z
       
       0 likes, 0 repeats
       
       @easthighNerd Firefox does have a feature like that, it's just an alternate stylesheet in a meta tag, but again, it only works in Firefox
       
 (DIR) Post #9ptZGQPyLLaDyK1Vtw by easthighNerd@niu.moe
       2019-12-12T17:13:54Z
       
       0 likes, 0 repeats
       
       @namwen The site is static (aside from when I mess around with it) Kind of thinking a button that would be able to switch between a light CSS and a dark CSS on the website. Any ideas on how that might be accomplished? (without any JavaScript)
       
 (DIR) Post #9ptZQSUPUoiNICsqAq by easthighNerd@niu.moe
       2019-12-12T17:15:42Z
       
       0 likes, 0 repeats
       
       @kiito While FF is my main browser (guess that also makes it my target browser), I would like it to work on as many browsers as possible. Thanks for sharing that feature btw!
       
 (DIR) Post #9ptaRubAZZdSiOImsy by ashwinvis@mastodon.acc.sunet.se
       2019-12-12T17:27:08Z
       
       0 likes, 0 repeats
       
       @easthighNerdhttps://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme
       
 (DIR) Post #9pudI3ZSqufKfRSNA8 by kelly_clowers@mastodon.technology
       2019-12-13T05:33:42Z
       
       0 likes, 0 repeats
       
       @easthighNerd Yes, but the way I know involves one style sheet built specifically for that, not e.g. different style sheets that can be selected. https://www.sitepoint.com/building-style-switcher-with-pure-css-using-checked/