Conversation
|
If you don't want this PR to be closed automatically in 28 days then you need to assign the label 'Do not close'. |
ad365d2 to
17c64ae
Compare
0df2951 to
8ffa332
Compare
d05acd5 to
94e990d
Compare
a4a3057 to
2cc0305
Compare
I didn't reproduce it this. Could you check/investigate? |
Its still happening to me in my Chrome for Mac. It does not show in both Firefox and Safari |
- also making sure toLessCode uses the same rule to resolve property value instead of just always assuming the array has two values - fixing the issue with scrollbars
sgiehl
left a comment
There was a problem hiding this comment.
I had another look through the screenshot and left some last comments. The possible regression in the menu is something we should clarify and fix if needed. Everything else can also be fixed later.
* adding 'Match browser' option to Settings for dark/light mode * adding tests and screenshots * simplifying themes.js and tests
All convos are resolved, possible regression in admin mobile side menu has been ok'd and clarified with product.
* adding reactive visualizations * fixing issue with sparklines in rowevolution graph do not change the colours when preferences change * fixing issues in transitions.js and dataTable_rowactions.js * fixing issue found from feedback
Description
This PR introduces dark mode for the main authenticated Matomo UI. ( UX-120 )
How to use it
Light (default)orDark, then save.No matching browser preferences for now
The codebase is already prepared for browser-preference matching, but this PR does not expose that option to users yet.
How it works
Theme values are now defined in PHP as either a single value or a [light, dark] pair. For example:
Those values are converted into CSS custom properties and LESS variables at asset-build time.
ThemeStyles::toLessCode()generates:rootCSS custom properties for the light values.[data-theme-mode="dark"].@media (prefers-color-scheme: dark)for[data-theme-mode="auto"].This means most LESS can simply use shared theme tokens such as:
The active mode is selected through a root data attribute on the main layout:
The front end updates that attribute when the user saves the setting, so normal CSS-driven parts of the UI switch without a full reload.
We also added an
.inDarkMode({ ... })mixin for exceptions. Example:That mixin is useful for true mode-specific edge cases, but it should be the exception, not the default. The preferred approach is to share the same LESS rule in both modes by using theme variables, because that keeps the code smaller and reduces maintenance cost.
Side effects (why this PR is so big)
To make dark mode possible, this PR also cleans up older styling and assets.
Risks
lighten(),darken(), orfade()directly to theme variables will no longer compile and must be updated.extensions/themes that instantiate or inspect ThemeStyles directly.
In scope
Dashboard
Data:
Core dashboard UI:
Specific widget and data visualization:
Shared UI primitives
All Websites
Administration
Plugin and settings administration:
Marketplace:
Known as out of scope
Plugins update (screenshots)
This PR will have impact on plugins UI screenshots:
Checklist
Review