Closed vince-p closed 4 years ago
It does feel like something is not working quite right with these settings. I spent a lot of time trying to enforce light mode, and did try clearing the browser cache but that does not change the pattern I've described above.
Thanks for reporting this. After re-reading through the details and hearing your results of clearing local data for the site in the web browser, we've released a fix so auto day/night only works when the day_night
mode is enabled. You can update to the latest master version to test out the fix.
Thanks for reopening this - much appreciated! I have updated to try this fix but it does not seem to work. When I serve my site locally, it does show up with a light background but when I deploy to netlify, then everything appears as dark. I have tried using a customised version of the mr_robot theme, with "light=true". With those settings, when I serve locally, the color scheme has black text on grey background and is not readable. When I deploy to netlify I get white text on a dark background. I cannot figure out how to get a white background on netlify.
The live website is here: https://vincep.cogscience.org/ The github repository is here: https://github.com/vince-p/academicprofile
I think this is related to some messing with the parse_theme in layouts/partials/functions/. The relevant part is:
{{ if $theme.light }} {{- $scr.Set "background" ($theme.background | default "#fff") -}} {{- $scr.Set "dark_background" "rgb(40, 42, 54)" -}} {{- $scr.Set "home_section_odd" $theme.home_section_odd -}} {{- $scr.Set "home_section_even" $theme.home_section_even -}} {{- $scr.Set "dark_home_section_odd" "hsla(231, 15%, 18%, 1)" -}} {{- $scr.Set "dark_home_section_even" "hsla(231, 15%, 16%, 1)" -}} {{ else }} {{- $scr.Set "background" ($theme.background | default "#fff") -}} {{- $scr.Set "dark_background" ($theme.dark.background | default "rgb(40, 42, 54)") -}} {{- $scr.Set "home_section_odd" "rgb(255, 255, 255)" -}} {{- $scr.Set "home_section_even" "rgb(247, 247, 247)" -}} {{- $scr.Set "dark_home_section_odd" $theme.home_section_odd -}} {{- $scr.Set "dark_home_section_even" $theme.home_section_even -}} {{ end }}
When I updated to the newest version, I found myself redefining parts of this for a complete day/night theme but my solution is a rather personalized hack.
Describe the bug
I would like my website to use the "mr robot" theme with a white background regardless of my system settings. Setting "light = true" in a customised version of the theme does not allow this. Also, when deploying the site to netlify, the theme settings do not render the same way as when I serve the site locally.
Other users have reported similar issues: https://spectrum.chat/academic/help/problem-with-light-theme~05c65080-e797-4c65-998b-290b438357d4
To Reproduce
This always results in a dark theme. There does not appear to be any way to ignore the system colour settings.
Note - setting "day_night = true" SOMETIMES allows setting a light theme manually once the page loads, but this seems to function inconsistently.
Expected behavior
When I set "light = true" in a custom theme, I expected that the theme would always be light regardless of system settings. If this is not the intended function, could we please have a way to ignore the system colour settings.
Technical details: