]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(theming): ensure image background is not defined if admin disabled it
authorJohn Molakvoæ <skjnldsv@protonmail.com>
Thu, 4 May 2023 07:57:29 +0000 (09:57 +0200)
committerJohn Molakvoæ <skjnldsv@protonmail.com>
Thu, 4 May 2023 11:02:49 +0000 (13:02 +0200)
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
apps/theming/lib/Themes/CommonThemeTrait.php
core/css/apps.scss

index e4afa892089efdf302063124f6523ee0f8a4be82..cd7210269231e257302d7bc6cdfd34b4abf58f0a 100644 (file)
@@ -95,15 +95,6 @@ trait CommonThemeTrait {
                $variables['--image-background-default'] = "url('" . $this->themingDefaults->getBackground() . "')";
                $variables['--color-background-plain'] = $this->defaultPrimaryColor;
 
-               // 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->defaultPrimaryColor;
-                       $variables['--image-background-plain'] = 'yes';
-                       // If no background image is set, we need to check against the shown primary colour
-                       $variables['--background-image-invert-if-bright'] = $isDefaultPrimaryBright ? 'invert(100%)' : 'no';
-               }
-
                // Register image variables only if custom-defined
                foreach (ImageManager::SUPPORTED_IMAGE_KEYS as $image) {
                        if ($this->imageManager->hasImage($image)) {
@@ -113,8 +104,18 @@ trait CommonThemeTrait {
                        }
                }
 
+               // 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->defaultPrimaryColor;
+                       $variables['--image-background-plain'] = 'yes';
+                       $variables['--image-background'] = 'no';
+                       // If no background image is set, we need to check against the shown primary colour
+                       $variables['--background-image-invert-if-bright'] = $isDefaultPrimaryBright ? 'invert(100%)' : 'no';
+               }
+
                if ($hasCustomLogoHeader) {
-                       $variables["--image-logoheader-custom"] = 'true';
+                       $variables['--image-logoheader-custom'] = 'true';
                }
 
                return $variables;
index 2e647b18620e7aa3ff2705ddbd0acaf48c30f999..10572614bea0e21b3aadbb837a0378ed8d0165c5 100644 (file)
@@ -46,7 +46,7 @@ html {
 body {
        // color-background-plain should always be defined. It is the primary user colour
        background-color: var(--color-background-plain, var(--color-main-background));
-       // color-background-plain should always be defined. It is the primary user colour
+       // image-background-plain means the admin has disabled the background image
        background-image: var(--image-background, var(--image-background-default));
        background-size: cover;
        background-position: center;