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
'Dark Mode' support in Hive admin theme #1383
Comments
Good stuff. Are you intending to make all the admin themes switchable between light and dark sides, or create a dedicated Dark Hive theme? Or only offer it in default Hive? |
I've not decided as yet. Choices are:
I'm in favour of option 2. However we could in theory have an amalgamation of options 2 and 3 whereby it respects the OS setting but can be overridden via a button (and some minor JavaScript). Therefore someone with their OS set to Dark Mode could still use the light theme and vice versa if they so wish and not be locked into OS-wide settings. If you go to my framework in Safari Technology Preview 72 or higher on macOS Mojave you'll see how option 2 works. Make sure 'Dark Mode CSS Support' is enabled in Develop - Experimental Features and you'll see the dark version (work in progress). |
Just a work-in-progress/proof of concept for now. Testing primarily restricted to Safari Tech Preview 71 or newer where `prefers-color-scheme` CSS media query is enabled. There are known issues - especially with Hive Neutral theme (please refrain from reporting issues related to this commit until it is more stable). We still need to debate how users will select Dark Mode - See #1383 and #1389 for history.
Dark Mode in Hive admin theme is in dev branch. It's got issues but gives an idea of how this can be implemented. To test it you'll currently need macOS 10.14 Mojave - set to Dark Mode - and use Safari Technology Preview 71 or newer (possibly Chrome Canary with feature flag on might work too but I haven't tested that browser yet - I know the feature is coming to that browser). |
Fwiw - Firefox 67 ?. According to the comment it is not yet “live”, you need to restart the browser for it to detect the OS theme. |
@phiw13 great, thanks for the heads-up. I'm currently on the Firefox 66 beta cycle so I'll test when the versions bump. |
Ah, caniuse has now got reporting for this feature too: https://caniuse.com/#feat=prefers-color-scheme |
Potential reference for user selectable way of setting light/dark theme directly in admin panel: https://petermolnar.net/os-theme-switcher-css-with-fallback/ |
FYI Firefox Dev Edition 67, released today, now supports |
FYI Safari 12.1, released yesterday, now supports |
I've written a purely JavaScript solution to allow users to override Dark/Light Mode directly in the webpage, or to toggle Dark/Light Mode even if they don't have a browser or OS that supports it. You can see the toggle in use in my framework: https://hive-framework.philwareham.co.uk So, if I use that method, we don't need to rely on theme-specific Textpattern preferences for this feature (it uses localStorage to store you preference per device/browser). |
Latest dev has user selectable dark/light modes for Hive admin theme now. Some style glitches still to be fixed and Hive Neutral hasn't been tidied up for dark mode yet - but feel free to test. It's the lightbulb icon near the logout button. Please don't report any style issues for now. Just test the toggle concept and see if you are happy with it. Basic usage is:
|
Dark Mode support finished - any styling tweaks I'll deal with as a non-issue. |
I've also back-ported this into the Textpattern 4.7.4 branch, if that gets an official release. |
Is your feature request related to a problem?
No - just an enhancement.
What is the feature?
Upcoming Safari (macOS) and Chrome (macOS) will support Dark Mode via CSS queries, I believe there is work ongoing to bring this to Windows browser versions too. I'd imagine future iOS will have a Dark Mode and Android already has.
So we should support Dark Mode in our primary admin theme, since this is a web app.
Note, I'm not too interested in bloating our default public theme with Dark Mode support - since it's subjective as to whether users want their websites to display that way (as opposed to a web app).
Safari Tech Preview v72 already has feature enabled for testing and I've been modifying my framework to bring in Dark Mode UI.
The text was updated successfully, but these errors were encountered: