Things I did today: my websites now automatically switch to a dark theme if your browser has one.
- https://www.davidrevoy.com/
- https://www.peppercarrot.com/
@davidrevoy do you mean "if it's actually set to a dark theme" or "if it's possible to switch to a dark theme"? (I'm a light-theme person and I'd hate for Firefox to switch to dark theme just because it can)
@irina There's no switch to choose a theme different from OS preference (yet?)
@RyunoKi @irina Hey, in themes Firefox has an 'auto' themes that follows the O.S. themes. At least, it works on Plasma/KDE, I haven't tried elsewhere. You can also specify a light or dark preferences for browsing (in Firefox themes).
Making a button on my website is complex; mainly because I would need to link it with a cookie system so it saves on your browser your preferences.
For this feature, I only had to write the last paragraph on https://www.davidrevoy.com/themes/blogtheme/css/theme.css
@davidrevoy @irina Not necessarily.
You could store it in local storage as well.
Personally I've designed mine in a way that it doesn't remember the choice currently:
https://code.jaenis.ch/andre/jaenis.ch_design-system/src/branch/main/components/theme-switcher.js
The styling is then controlled via a class on <body>.
I usually license with AGPL v3 or newer. But this is MIT because legacy (haven't updated the year )
https://code.jaenis.ch/andre/jaenis.ch_design-system/src/branch/main/LICENSE.txt
According to
https://www.gnu.org/licenses/license-list.en.html
it's compatible.