Skip to content

Commit

Permalink
Merge pull request #38433 from nextcloud/fix/theming-invert-25
Browse files Browse the repository at this point in the history
[stable25] fix(theming): fix header primary invert if background disabled
  • Loading branch information
szaimen authored Jun 12, 2023
2 parents f0467b0 + 328fa18 commit cf20825
Showing 1 changed file with 4 additions and 1 deletion.
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

0 comments on commit cf20825

Please sign in to comment.