You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apps which support the dark color scheme should have a toggle where the system default can be overridden. The dark model config should be changed to set the color-scheme value like the example below:
<htmllang="en" data-color-scheme="dark"><head><styletype="text/css">
[data-color-scheme="dark"] {
color-scheme: dark;
}
[data-color-scheme="light"] {
color-scheme: light;
}
</style></head><body><div><buttonid="light">light</button><buttonid="dark">dark</button><buttonid="system">system</button><divstyle="margin-top: 3ex"><inputtype="datetime-local" required/><br><br><inputtype="text" placeholder="dummy input" /></div></div><script>(()=>{letscheme="system";functionsystemColorScheme(){if(window.matchMedia){returnwindow.matchMedia('(prefers-color-scheme: dark)').matches
? "dark" : "light";}return"light";}functionsetColorScheme(newScheme){scheme=newScheme;document.documentElement.setAttribute("data-color-scheme",scheme==="system" ? systemColorScheme() : scheme,);}if(window.matchMedia){// watch for global changes to color schemewindow.matchMedia('(prefers-color-scheme: dark)').addEventListener('change',()=>{console.log('CHANGED, current pref: ',scheme);if(scheme==="system"){setColorScheme("system");}});}setColorScheme(scheme);document.querySelector("#light").addEventListener("click",()=>{setColorScheme("light");});document.querySelector("#dark").addEventListener("click",()=>{setColorScheme("dark");});document.querySelector("#system").addEventListener("click",()=>{setColorScheme("system");});})();</script></body></html>
The text was updated successfully, but these errors were encountered:
Apps which support the dark color scheme should have a toggle where the system default can be overridden. The dark model config should be changed to set the color-scheme value like the example below:
The text was updated successfully, but these errors were encountered: