Merge pull request #38433 from nextcloud/fix/theming-invert-25

[stable25] fix(theming): fix header primary invert if background disabled
This commit is contained in:
Simon L 2023-06-12 15:20:27 +02:00 committed by GitHub
commit cf20825a71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -87,13 +87,15 @@ trait CommonThemeTrait {
$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';
}
}
@ -164,6 +166,7 @@ trait CommonThemeTrait {
if ($globalBackgroundDeleted) {
return [
'--image-background-plain' => 'true',
'--background-image-invert-if-bright' => $this->util->invertTextColor($this->primaryColor) ? 'invert(100%)' : 'no',
];
}
}