Conversation
Contributor
|
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
This was referenced Mar 9, 2026
d05acd5 to
94e990d
Compare
a4a3057 to
2cc0305
Compare
tzi
commented
Mar 26, 2026
| /** | ||
| * @var string|array<string> | ||
| */ | ||
| public $colorBoxShadow = ['rgba(0, 0, 0, 0.1)', 'rgba(0, 0, 0, 0.1)']; |
Contributor
Author
There was a problem hiding this comment.
ℹ️ If we do a light box-shadow in dark mode, it doesn't look the same at all. More an highlight than stacking shadow.
tzi
commented
Mar 26, 2026
| $view->emailStyles = $emailStyles; | ||
|
|
||
| $view->fontStyle = 'color:' . $themeStyles->colorText . ';font-family:' . $themeStyles->fontFamilyBase . ';'; | ||
| $view->fontStyle = 'color:' . $themeStyles->getPropertyValue('colorText') . ';font-family:' . $themeStyles->getPropertyValue('fontFamilyBase') . ';'; |
Contributor
Author
There was a problem hiding this comment.
ℹ️ We avoid direct access to a color, because it could be defined as an array.
tzi
commented
Mar 26, 2026
Comment on lines
+13
to
+31
|
|
||
| .whatisnew .card { | ||
| .inDarkMode({ | ||
| background: @theme-color-background-tinyContrast; | ||
| }); | ||
| } | ||
|
|
||
| .whatisnew-changelist { | ||
| overflow-y: scroll; | ||
| max-height: 500px; | ||
| margin-bottom: 10px; | ||
| padding-right: 5px; | ||
| padding-left: 5px; | ||
| } | ||
|
|
||
| .whatisnew-btn { | ||
| float:right; | ||
| margin-left: 10px; | ||
| } |
Contributor
Author
There was a problem hiding this comment.
ℹ️ Moved from layout.less
* adding changes.json for Dark mode * removed double space
chippison
reviewed
Mar 29, 2026
| padding: 15px; | ||
| } | ||
|
|
||
| .inDarkMode({ |
Contributor
There was a problem hiding this comment.
Why are we not using variables in this file?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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