-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Determine Light or Dark Mode for Image Tag #63
Comments
var config_mode = '${Extras.Appearance.mode}';
var theme_mode = 'light';
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
theme_mode = 'dark';
}
// Override mode by config
if(config_mode != "auto") {
theme_mode = config_mode;
} Source: Line 26 in 39125e0
|
@Pogs2004 I would like to integrate that in my fork as well |
Thanks @W0CHP, I was hoping there would be a global tag for light or dark, but $Extras.Appearance.mode just comes from the skin.conf so can be light, dark or auto. In the end I wrote a wee function to determine if the browser is in dark or light mode:
This works fine on all major browsers / devices. |
Hi,
Not an issue as such but I have added a sun path diagram to my Ephemeris (Almanac) page:
https://www.360shetland.co.uk/weather/almanac.html
I have two versions of the diagram, light and dark (which is currently loaded). What I would like to do is have the jpg image change depending on whether the colour scheme is in light or dark auto mode. Is there a tag somewhere that picks up whether the device is in light or dark mode?
My ultimate goal is to code a 3D sun path diagram that takes the time and date from the app, similar to this:
http://andrewmarsh.com/apps/staging/sunpath3d.html
Thanks,
Rory
The text was updated successfully, but these errors were encountered: