From 064fa10ecfe4725398895a21ab8bafd171e2eadd Mon Sep 17 00:00:00 2001 From: John Molakvoæ Date: Thu, 20 Oct 2022 16:03:19 +0200 Subject: Extract colour from custom background MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- apps/theming/src/AdminTheming.vue | 11 +- apps/theming/src/components/BackgroundSettings.vue | 114 ++++++++++++++++----- 2 files changed, 97 insertions(+), 28 deletions(-) (limited to 'apps/theming/src') diff --git a/apps/theming/src/AdminTheming.vue b/apps/theming/src/AdminTheming.vue index 1d9f5b69512..4b1877ccf7d 100644 --- a/apps/theming/src/AdminTheming.vue +++ b/apps/theming/src/AdminTheming.vue @@ -285,8 +285,15 @@ export default { background-position: center; text-align: center; margin-top: 10px; - background-color: var(--color-primary-default); - background-image: var(--image-background-default, var(--image-background-plain, url('../../../core/img/app-background.jpg'), linear-gradient(40deg, #0082c9 0%, #30b6ff 100%))); + /* This is basically https://github.com/nextcloud/server/blob/master/core/css/guest.css + But without the user variables. That way the admin can preview the render as guest*/ + /* As guest, there is no user color color-background-plain */ + background-color: var(--color-primary-default, #0082c9); + /* As guest, there is no user background (--image-background) + 1. Empty background if defined + 2. Else default background + 3. Finally default gradient (should not happened, the background is always defined anyway) */ + background-image: var(--image-background-plain, var(--image-background-default, linear-gradient(40deg, #0082c9 0%, #30b6ff 100%))); &-logo { width: 20%; diff --git a/apps/theming/src/components/BackgroundSettings.vue b/apps/theming/src/components/BackgroundSettings.vue index 9890f9ad3f0..e1d8b731bc4 100644 --- a/apps/theming/src/components/BackgroundSettings.vue +++ b/apps/theming/src/components/BackgroundSettings.vue @@ -1,10 +1,10 @@