diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2022-04-28 20:30:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-28 20:30:59 +0300 |
commit | 350d0261eaa2c78832d6666bd154de1cbf35fe8a (patch) | |
tree | 4dac2d4b81523a085e4296f2cbeeb9c1994f8f79 /apps | |
parent | f72f81158d824512dcd0dd4e06484e06fdb21d6d (diff) | |
parent | 5e8a3eb66c312e46e35824ada4bb4e4642279912 (diff) |
Merge pull request #32204 from nextcloud/fix/invert-logo
Diffstat (limited to 'apps')
-rw-r--r-- | apps/theming/css/default.css | 4 | ||||
-rw-r--r-- | apps/theming/lib/Themes/DefaultTheme.php | 15 |
2 files changed, 14 insertions, 5 deletions
diff --git a/apps/theming/css/default.css b/apps/theming/css/default.css index 4bd9fb13bb8..a2b4b4c7b60 100644 --- a/apps/theming/css/default.css +++ b/apps/theming/css/default.css @@ -52,6 +52,6 @@ --header-menu-item-height: 44px; --header-menu-profile-item-height: 66px; --breakpoint-mobile: 1024px; - --primary-invert-if-bright: unset; - --background-invert-if-dark: unset; + --primary-invert-if-bright: no; + --background-invert-if-dark: no; } diff --git a/apps/theming/lib/Themes/DefaultTheme.php b/apps/theming/lib/Themes/DefaultTheme.php index b13e481907a..a98d9099d95 100644 --- a/apps/theming/lib/Themes/DefaultTheme.php +++ b/apps/theming/lib/Themes/DefaultTheme.php @@ -89,6 +89,8 @@ class DefaultTheme implements ITheme { $colorBoxShadow = $this->util->darken($colorMainBackground, 70); $colorBoxShadowRGB = join(',', $this->util->hexToRGB($colorBoxShadow)); + $hasCustomLogoHeader = $this->imageManager->hasImage('logo') || $this->imageManager->hasImage('logoheader'); + $variables = [ '--color-main-background' => $colorMainBackground, '--color-main-background-rgb' => $colorMainBackgroundRGB, @@ -175,8 +177,11 @@ class DefaultTheme implements ITheme { // to be used for legacy reasons only. Use inline // svg with proper css variable instead or material // design icons. - '--primary-invert-if-bright' => $this->util->invertTextColor($this->primaryColor) ? 'invert(100%)' : 'unset', - '--background-invert-if-dark' => 'unset', + // ⚠️ Using 'no' as a value to make sure we specify an + // invalid one with no fallback. 'unset' could here fallback to some + // other theme with media queries + '--primary-invert-if-bright' => $this->util->invertTextColor($this->primaryColor) ? 'invert(100%)' : 'no', + '--background-invert-if-dark' => 'no', ]; // Register image variables only if custom-defined @@ -185,7 +190,7 @@ class DefaultTheme implements ITheme { if ($this->imageManager->hasImage($image)) { // If primary as background has been request, let's not define the background image if ($image === 'background' && $backgroundDeleted) { - $variables["--image-background-plain"] = true; + $variables["--image-background-plain"] = 'true'; continue; } else if ($image === 'background') { $variables['--image-background-size'] = 'cover'; @@ -194,6 +199,10 @@ class DefaultTheme implements ITheme { } } + if ($hasCustomLogoHeader) { + $variables["--image-logoheader-custom"] = 'true'; + } + return $variables; } |