aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorskjnldsv <skjnldsv@protonmail.com>2025-03-25 17:08:00 +0100
committerskjnldsv <skjnldsv@protonmail.com>2025-03-25 17:32:03 +0100
commitc11d98dd1e2e1f0d9657fd9cb068ff62d68d06e4 (patch)
tree911d0b9d11609423f3bb67c115e43837d4db30eb
parentd1383602c767bd925c00b7642d062c06aa4012a3 (diff)
downloadnextcloud-server-feat/dark-mode-variables.tar.gz
nextcloud-server-feat/dark-mode-variables.zip
feat(theming): define `nextcloud-theme-dark` variablefeat/dark-mode-variables
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
-rw-r--r--apps/theming/css/default.css1
-rw-r--r--apps/theming/lib/Themes/DarkTheme.php2
-rw-r--r--apps/theming/lib/Themes/DefaultTheme.php2
3 files changed, 5 insertions, 0 deletions
diff --git a/apps/theming/css/default.css b/apps/theming/css/default.css
index ad5b27530c3..63592033c13 100644
--- a/apps/theming/css/default.css
+++ b/apps/theming/css/default.css
@@ -1,6 +1,7 @@
/** SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors */
/** SPDX-License-Identifier: AGPL-3.0-or-later */
:root {
+ --nextcloud-theme-dark: 0;
--color-main-background: #ffffff;
--color-main-background-rgb: 255,255,255;
--color-main-background-translucent: rgba(var(--color-main-background-rgb), .97);
diff --git a/apps/theming/lib/Themes/DarkTheme.php b/apps/theming/lib/Themes/DarkTheme.php
index fd273d4697d..d12ff79146e 100644
--- a/apps/theming/lib/Themes/DarkTheme.php
+++ b/apps/theming/lib/Themes/DarkTheme.php
@@ -61,6 +61,8 @@ class DarkTheme extends DefaultTheme implements ITheme {
$defaultVariables,
$this->generatePrimaryVariables($colorMainBackground, $colorMainText),
[
+ '--nextcloud-theme-dark' => 1,
+
'--color-main-text' => $colorMainText,
'--color-main-background' => $colorMainBackground,
'--color-main-background-rgb' => $colorMainBackgroundRGB,
diff --git a/apps/theming/lib/Themes/DefaultTheme.php b/apps/theming/lib/Themes/DefaultTheme.php
index 1a301eb9820..0187d5f6185 100644
--- a/apps/theming/lib/Themes/DefaultTheme.php
+++ b/apps/theming/lib/Themes/DefaultTheme.php
@@ -101,6 +101,8 @@ class DefaultTheme implements ITheme {
};
$variables = [
+ '--nextcloud-theme-dark' => 0,
+
'--color-main-background' => $colorMainBackground,
'--color-main-background-rgb' => $colorMainBackgroundRGB,
'--color-main-background-translucent' => 'rgba(var(--color-main-background-rgb), .97)',