From 7c5bb555e72dc2ebe285d46776dba735a4005a3f Mon Sep 17 00:00:00 2001 From: John Molakvoæ Date: Thu, 28 Apr 2022 09:42:49 +0200 Subject: Fix logo colour on bright primary colour MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- apps/theming/lib/Themes/DefaultTheme.php | 6 ++++++ core/css/header.scss | 8 ++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/theming/lib/Themes/DefaultTheme.php b/apps/theming/lib/Themes/DefaultTheme.php index b13e481907a..9c3dcf56faf 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, @@ -194,6 +196,10 @@ class DefaultTheme implements ITheme { } } + if ($hasCustomLogoHeader) { + $variables["--image-logoheader-custom"] = true; + } + return $variables; } diff --git a/core/css/header.scss b/core/css/header.scss index 4c107c0d58f..2e53571a806 100644 --- a/core/css/header.scss +++ b/core/css/header.scss @@ -182,12 +182,8 @@ left: 12px; top: 1px; bottom: 1px; - - img { - opacity: 0; - max-width: 100%; - max-height: 200px; - } + // Invert custom logo if primary too bright + filter: var(--image-logoheader-custom, var(--primary-invert-if-bright)) } .header-appname-container { -- cgit v1.2.3