Skip to content
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

[stable25] fix(theming): fix header primary invert if background disabled #38433

Merged
merged 1 commit into from
Jun 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/theming/lib/Themes/CommonThemeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,15 @@ protected function generateGlobalBackgroundVariables(): array {
$hasCustomLogoHeader = $this->util->isLogoThemed();

$variables = [];
$defaultColorPrimary = $this->themingDefaults->getDefaultColorPrimary();

// If primary as background has been request or if we have a custom primary colour
// let's not define the background image
if ($backgroundDeleted) {
$variables['--color-background-plain'] = $this->themingDefaults->getColorPrimary();
$variables['--color-background-plain'] = $defaultColorPrimary;
if ($this->themingDefaults->isUserThemingDisabled() || $user === null) {
$variables['--image-background-plain'] = 'true';
$variables['--background-image-invert-if-bright'] = $this->util->invertTextColor($defaultColorPrimary) ? 'invert(100%)' : 'no';
}
}

Expand Down Expand Up @@ -164,6 +166,7 @@ protected function generateUserBackgroundVariables(): array {
if ($globalBackgroundDeleted) {
return [
'--image-background-plain' => 'true',
'--background-image-invert-if-bright' => $this->util->invertTextColor($this->primaryColor) ? 'invert(100%)' : 'no',
];
}
}
Expand Down