๐ ๐ฆ 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/
David Revoy - Artist, Instructor, using only Free/Libre and Open-Source software since 2009.
Website of David Revoy, artist and instructor using only Free/Libre and Open-Source software since 2009.David Revoy
Erik Uden ๐
•Guilhem Saurel
•Raphael Rochet
•Luc, lit beaucoup
•Irina
•Ryuno-Ki
•@irina There's no switch to choose a theme different from OS preference (yet?)
@davidrevoy
David Revoy
•@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
Ryuno-Ki
•@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>.
jaenis.ch_design-system
Forgejo: Beyond coding. We Forge.David Revoy
•@RyunoKi Thanks for sharing your solution. I'll try to adapt it so I can put a little lightbulb symbolic icon somewhere that switch it on/off.
@irina
Ryuno-Ki
•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.
jaenis.ch_design-system
Forgejo: Beyond coding. We Forge.Ryuno-Ki
•Since your CSS is GPL:
1. Where can I find the source?
2. Do you accept Merge Requests?
@irina
David Revoy
•@RyunoKi my blog theme doesn't have a repo (but the engine, PLuXML has one). Yes, I put the GPL on the CSS because I had copies in the past by theme make/seller.
For Pepper&Carrot, the website is entirely here: https://framagit.org/peppercarrot/website-2021/-/merge_requests/106 (this is the MR of the dark theme). Thanks for the help
Add a global "dark theme" (!106) ยท Merge requests ยท peppercarrot / website ยท GitLab
GitLabRyuno-Ki
•Doesn't load right away (not even framagit).
Will try again later.
David Revoy
•Ryuno-Ki
•You're welcome.
I placed my switcher in the footer. There are several places that could be expected.
Might be a good time to think of โskip toโ links for my site now that we speak about it ๐ค
Ryuno-Ki
•Created an account on framagit, but have to await approval by the instance admin (in case you need to vouch).
Meanwhile cloned the repo.
David Revoy
•Ryuno-Ki
•Pool dessins
•