Add light/dark mode switching#5256
Conversation
e0d517c to
d1fce9c
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5256 +/- ##
============================================
- Coverage 35.39% 35.39% -0.01%
- Complexity 11183 11184 +1
============================================
Files 1165 1165
Lines 48001 48003 +2
============================================
Hits 16990 16990
- Misses 31011 31013 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
08daedd to
ebc280a
Compare
|
Disclaimer. I have never used dark mode for more than a few seconds. Using code written by my favorite LLM, you can add this code to each page using the custom CSS/JS module. This automatically inherits the light/dark mode from the browser - which, if set to "automatic", will inherit it from the operating system. I tried it, and IMHO it looks awful. I think the individual themes will need lots of work to be compatible with bootstrap dark mode. |
I think you are misunderstanding the purpose of this. The reason for adding this is for theme makers to be able to easily select the "base theme" from bootstrap to base their own theme on. By doing that, lots of variables will already have reasonable colors set for a dark theme and the theme CSS can be made much more compact. |
|
It is a bit tempting though to look at making a very plain "bootstrap" theme for webtrees with light and dark setting (or automatic switching) and as little CSS as possible. |
I am open to the idea of converting the minimal theme to a bootstrap theme... |
|
I have decided to add a new theme method It defaults to false. The minimal theme sets it to true. When set, light/dark mode is selected, based on the browser/OS settings. Updated in c0f97f5 |

Had a go at implementing #5255, not sure if it's the right way to do it.
Resolves #5255