User tests: Successful: Unsuccessful:
oxide-dark
when the template communicates it will be using a dark colour scheme. This can be turned off BOTH at the template style level AND at the editor plugin level.editor.css
already does that.public function onTemplateDarkModeSupported(bool $forcedDark)
and a matching \Joomla\CMS\Editor\Editor::notifyDarkMode
method for templates to notify editors that dark mode is to be applied.Install one of the pre-built packages.
Switch your browser to Dark Mode (see How To Test Dark Mode below). The Joomla backend appears with a dark colour scheme.
Use as many core features as you can.
Switch your browser to Dark Mode.
Edit the default backend template style. In the Dark Mode tab set the dark mode option to Always Light.
All backend pages, including the login page are using a light colour scheme.
Switch your browser to Light Mode.
Edit the default backend template style. In the Dark Mode tab set the dark mode option to Always Dark.
All backend pages, including the login page are using a dark colour scheme.
Switch your browser to Dark Mode.
Edit the default backend template style. In the Dark Mode tab set the dark mode option to Browser Preference.
Edit your user. Under Basic Settings set the dark mode option to Always Light.
All backend pages, except the login page, are using a light colour scheme when you log into your site with this user account.
Switch your browser to Light Mode.
Edit the default backend template style. In the Dark Mode tab set the dark mode option to Browser Preference.
Edit your user. Under Basic Settings set the dark mode option to Always Dark.
All backend pages, except the login page, are using a dark colour scheme when you log into your site with this user account.
On Windows 10, Windows 11, macOS Catalina or later, iOS/iPadOS 13 or later, and GNOME it is generally sufficient to switch your Operating System colour scheme to dark.
All browsers except Safari and on all OS except macOS, iOS, and iPadOS let you choose whether the browser's colour scheme will follow the OS colour scheme or not. For example, Chrome has an option for the theme under settings, appearance. Using an option called Auto, System, or GTK will use the OS colour scheme.
If you are using Linux but NOT GNOME as your desktop environment auto-switch between light and dark mode may not work. Choose one.
If you don't know if your browser auto-switched to dark mode please visit duckduckgo.com or Dionysopoulos.me. If the site appears with a prominently dark background your browser has switched to dark mode.
Please select:
Documentation link for docs.joomla.org: See below; cannot do PRs to docs.joomla.org!
Pull Request link for manual.joomla.org: Joomla Manual PR 66
Since it is not possible to make a PR to docs.joomla.org I am putting the documentation in four sections below and I'm waiting for instructions on how and when to proceed.
URL: ATUM IS NOT DOCUMENTED(!!!) as per https://docs.joomla.org/JDOC:Joomla_4_Tutorials_Project
The Dark Mode section works similarly to the Colour Settings section. It allows you to set up the colours of the template — but for an optional, dark color scheme.
The Atum backend template lets you display the Joomla administrator backend in a dark colour scheme, suitable for low ambient light conditions and people with photosensitivity. Whether and when to use this color scheme is determined by the Dark Mode support option and can be overridden in the preferences of every user who has backend access. Please note that the setting of the Dark Mode support option in the default backend template style also controls whether the administrator login page will be displayed with a dark color scheme.
It can have one of the following settings:
Atum can also communicate the dark colour scheme configuration to the editor plugins in Joomla, as long as the Dark Mode support in editors option is enabled. Please note that this only sends a signal to the editor plugin, communicating if and when a dark colour scheme needs to be applied. It is up to the editor plugin to act on this signal. The TinyMCE and CodeMirror editor plugins shipped with Joomla support and respect this signal. For third party editor plugins please refer to their documentation as supplied by their developers.
The rest of the options are identical to those found under Colour Settings and have the same meaning, but only apply when the dark colour scheme is in use.
URL: https://help.joomla.org/proxy?keyref=Help42:Users:_Edit_Profile&lang=en
(Place this under section 4.3 Basic settings, below “Backend Template Style”)
URL: https://docs.joomla.org/Chunk4x:Extensions_Plugin_Manager_Edit_Editor_Group/en#Editor_-_CodeMirror
Dark Mode.
This tab allows you to choose what happens when your site displays with a dark color scheme. Please note that options in this tab may not work with all front- and backend templates. The settings will only be applied if the template communicates that it's using a dark colour scheme.
URL: https://docs.joomla.org/Chunk4x:Extensions_Plugin_Manager_Edit_Editor_Group/en#Editor_-_TinyMCE
Dark Mode.
This tab allows you to choose what happens when your site displays with a dark color scheme. Please note that options in this tab may not work with all front- and backend templates. The settings will only be applied if the template communicates that it's using a dark colour scheme.
editor.css
file. If unsure, ask your template developer.Please note that the “Auto-apply Dark Mode” option only takes effect if you have selected either - Use Default -
or oxide
in the Plugin tab options “Site Skin” (applies to the site's frontend only) and “Administrator Skin” (applies to the site's backend only). If you have chosen a different skin that skin will be used when your template displays in both light and dark color schemes.
As noted, not all templates communicate their dark color scheme preference to editors — or can be configured not to do that. In this case the options in the Plugin tab apply.
The PR is generally backwards compatible i.e. nothing breaks code-wise.
The introduction of the dark mode MAY cause minor display issues in some third party extensions. Extension developers are very strongly encouraged to support dark mode using the developer documentation (see the PR to manual.joomla.org).
Third party editor plugin developers are strongly encouraged to support dark mode using the developer documentation (see the PR to manual.joomla.org).
This PR introduces new language strings. This happens in the alpha stage which gives translation teams adequate time to work through these very few language strings.
Upon consulting with @crystalenka, I was told that the best way to go about implementing Dark Mode is to introduce CSS variables for distinct color patterns everywhere in the backend. Their utility reaches far beyond the implementation of dark mode. They can be used as a starting point for reworking the backend template into reusable components. They can be used to offer a real high contrast mode (instead of the current cop-out of just applying a filter which increases the overall contrast by 25%, with dubious results). In theory, someone could use them to provide an entirely different color scheme without having to override Bootstrap's SCSS defines, e.g. if someone with real commitment to their cause wants to create a child template of Atum.
TinyMCE unfortunately has its own weird way of handling CSS for its themes and it works by applying a CSS file in the IFRAME created in the Shadow DOM when the editor is initialised at runtime. It's not possible to load an additional CSS file after the fact, nor is it possible to load two or more CSS files (skins) at once. This normally limits TinyMCE to either a light (oxide) or dark (oxide-dark) skin.
In order to support dynamic colour scheme switching of the editor's UI following the browser settings (if that's what the user has opted for) I had to create a combined theme which is the oxide skin with the colour settings (and only the colour settings!) of the oxide-dark skin when the browser indicates we need to use a dark scheme. Hence the extra CSS.
If you have to ask this question it means you didn't test the PR
Seriously now, please DO NOT ask me questions which are self-evident if you actually test this PR. It will add to my workload and slow down this PR unnecessarily.
Hold up!
Visit the following sites:
If you do NOT see the light/dark color scheme you expected, then the problem is with your setup. Remember that for dark mode to switch automatically you will need one of the following:
If you see the correct color scheme you expected in all three sites but not in the site you are testing please make sure that:
npm ci
if you are using the repository sources (otherwise the CSS files WILL NOT BE REBUILT).Remember that the default settings for the backend template is to follow the browser's preference and communicate the dark mode setting to the editor. The default for the user settings is to do whatever the template style says.
Make sure the template style has the Dark Mode support in editors
option enabled (that's the default). Make sure that you are using either TinyMCE or CodeMirror supplied with Joomla itself; third party editors cannot possibly implement dark mode support before this PR is merged. Make sure that the editor you are using is set up to support dark mode (default).
Also remember that TinyMCE will only change its skin if you have selected the default skin, oxide. If you have selected oxide-dark, then oxide-dark will always be used and the content will NOT change to dark mode. This is deliberate as we don't want to catch users by surprise if they are using a non-default skin.
Do keep in mind that CodeMirror can be set up to use a non-default theme. It is possible that you've set it up to use a theme which is already dark. It is also possible to select a light-coloured theme for CodeMirror's dark mode as there is no positive indication in the theme names which one is light and which one is dark (at least, it's not consistent, therefore cannot be used).
Because the dark colour scheme themes DO NOT follow a consistent naming pattern. For example, Darcula and Dracula are dark colour scheme themes but do not have "dark" in their name.
To paraphrase Steve Jobs: “we have the reasonable expectation that our users are not stupid”.
Chances are that it does not support Dark Mode for the simple reason that Dark Mode did not exist before Joomla 4.3, i.e. when this PR will be merged.
It is also likely that my own extensions will need a bit of a reworking to play well on Joomla 4.3 which is to say that I'm not giving myself an unfair advantage here. All of us 3PDs are in the same position.
Do you have a 3PD extension implementing its own dark colour scheme, such as my DarkMagic plugin? Disable it!
There's only so much I can do when working with the limited palette of Dark Mode.
HOWEVER! Since we're using CSS variables everywhere I would expect that the fine folks at the Joomla Accessibility Team (most likely the design expert @angieradtke) can come up with a high contrast light and dark colour scheme we can very easily include in Atum. Moreover, if colours do need to be adjusted the JAT can very easily make the changes in the SCSS files as there are only two files (build/media_source/templates/administrator/atum/dark/_variables.scss and _root.scss) which need changing to tweak colours.
The idea here is to provide the groundwork for allowing multiple colour schemes in Joomla templates. We MUST NOT have the expectation that Joomla 4.3 will have a super duper ultra accessible and fully refined dark mode. This is something which will reasonably take the rest of the time to Joomla 4.4 / 5.0 to get there for two very simple reasons:
Also keep in mind that unlike every other decision made in Joomla 4's templates, the decisions here are made in public, in the main repository. Everyone can see why at some point we have to say “that's good enough for version 1 of this feature” instead of making up a story. This is far more helpful in that it communicates the decision context and deadline limits we have to address when making these decisions. When we introduce a massive new feature we aim for a minimum viable product, not absolute perfection. Even multi-trillion dollar companies like Microsoft, Google, and Apple follow this approach; who are we to pretend we can do better with less than a billionth of their budget?
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_users Language & Strings Templates (admin) Repository NPM Change |
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-12-07 12:24:38 |
Closed_By | ⇒ | nikosdion | |
Labels |
Added:
Language Change
a11y
NPM Resource Changed
PR-4.3-dev
?
|
Status | Closed | ⇒ | New |
Closed_Date | 2022-12-07 12:24:38 | ⇒ | |
Closed_By | nikosdion | ⇒ |
Status | New | ⇒ | Pending |
Details element: fixed.
Calendar in dark mode: fixed.
Calendar in light mode: does not come from the template. This is native drop-down styling, i.e. your browser and operating system render it with their own style.
All items reported by you are fixed.
Good catch on CodeMirror! There was a missing parenthesis. Now it's fixed.
Regarding the colours of the alerts, these are the same in light mode and actually come from Joomla's Alerts web component. I will try to change them to something more subtle.
I have had a look into this and my first thought was: So many changes just for a different color scheme.
I have also learned that bootstrap is working on a dark mode.
There are good things in this PR, e.g. using css variables. Make sense to change it, but I wouldn't do it btw. with such massive change for testing purposes.
I would wait till we merged the bootstrap version with dark mode and make the ajustments we need for joomla after that. So we don't run into conflicts.
@rdeutz You have missed the entire point of this PR.
All of the SCSS changes are for adding CSS variables. The entirety of Dark Mode-specific changes can be found in the build/media_source/templates/administrator/atum/scss/dark
folder.
The vast majority of Dark Mode changes are for Joomla-specific CSS which has nothing at all to do with Bootstrap itself. This work will have to be redone, it is extremely tedious, and I am not going to be redoing that for free.
Even if that was a problem, Joomla's editor plugins do not have a concept of Dark Mode and do not use Bootstrap at all, either. The fact remains that you would still need to redo all the work I've already done to support dark mode in plugins and, knowing Joomla, it would be so narrow-minded that it would not work with third party editors. In contrast, I made something that I'm pretty sure would make @ryandemmer happy to support in JCE, for example.
Another problem is that Bootstrap 5.3 supporting dark mode is something that will not be merged in Joomla 5.0 because it won't be ready by the time you need to start releasing beta versions 6 months before the stable, i.e. in April 2023 — that's less than 5 months from now.
Since Bootstrap's dark mode is a massive b/c break you will not be able to include it in Joomla 5 unless there was already work done in Joomla 4 to introduce the concept of dark mode and even then it would be questionable whether doing that would be acceptable under Joomla's b/c promise. So you're talking about introducing Dark Mode in Joomla 6, i.e. in 2025. It will be 2027 before 3PDs can safely support it across all supported Joomla versions. Dark Mode was implemented in browsers in 2019. In other words, Joomla will find itself AGAIN being 8 years behind — just like with Joomla 3.10 in 2021.
Finally, can you explain what would be a conflict in your mind? Bootstrap 5.3 has hard-coded dark mode colours. Converting what I did to BS 5.3 would be trivial: remove my dark/_root.scss and use the colours I've defined in Bootstrap itself. You will need to do minimal work to introduce CSS variables for the dark colours. If you were to start from scratch AFTER merging BS 5.3 you would need to convert Atum to use CSS variables everywhere and replicate all the work I did on BS colours, core overrides' colours, editor dark mode support and so on. This would more than double the scope of merging BS 5.3 into Joomla, meaning this just would not happen. Half-assing it by merging BS 5.3 without working on everything else Dark Mode related would result in a broken experience, therefore the project would end up disabling BS 5.3's dark mode and not working on Dark Mode ever again.
I will stop working on this PR.
I will leave it open so that people can see that I put the work into helping Joomla and the OSM President at the time shut me down, deciding to keep Joomla chained to legacy forevermore.
For anyone interested in implementing Dark Mode on their sites, you're welcome to use my DarkMagic plugin. I will keep maintaining it and improve it with what I learned working on Dark Mode in the core. I refuse to have my own site suck hairy balls because of a recalcitrant Joomla leadership.
That's also the last time you see me trying to contribute anything of substance. It's very clear that the work I put into Joomla has never been appreciated. Good luck and thanks for all the fish.
Over and out.
I hopefull don't have to explain the concept of different opions. I have spoken as Robert and not as OSM President, even if I would have spoken as OSM President it wouldn't matter more.
You should know that I have apreciated the work you have done for Joomla, if not I do. In this case a have a different opinion thats all. My opinion counts as much as others do and I am able to accept, if this PR gets merged even I don't like it fully.
@Bond97 I think Nik has already answered that in his comment above #39366 (comment) :
Regarding the colours of the alerts, these are the same in light mode and actually come from Joomla's Alerts web component. I will try to change them to something more subtle.
@nikosdion The PHPCS check in Drone reports 2 code style errors. For the first one I could propose a change here, but the 2nd one seems strange to me because indentation in that complete file is weird at that place at least for the comments also before your PR. Maybe you can run ./libraries/vendor/bin/phpcs --extensions=php -p --standard=ruleset.xml .
locally, and if PHPCBF could fix it, run ./libraries/vendor/bin/phpcs --extensions=php -p --standard=ruleset.xml .
?
Update: If that doesn't work for you or you don't have time, I can do that, but not today. Maybe tomorrow or on weekend, and if I can fix it I can make a PR for you.
Apparently Dimitris thinks he knows how to do Dark Mode better even though he has never done it in Joomla and I've been on it for the past 3 years.
I am closing this PR. Tell Dimitris who does not understand that any use case beyond his own exists and has never followed up with anything he ever contributed to do it. IDGAF anymore. I have my own Dark Mode solution. The Joomla Project can go pound sand for all I care.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-12-08 22:33:14 |
Closed_By | ⇒ | nikosdion |