Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2022-09-23 11:24:21 +0300
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2022-09-24 08:38:47 +0300
commit019e85d92c962b9fe1616e99d991f28b9c3e671e (patch)
treede1811d357254a5021537b6e9f95b9ef7cc01796 /apps/theming/lib
parent1fae3ae4aeda620f922b8f0fa7ba89c77b24a090 (diff)
Fixing dark primary element variables
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/theming/lib')
-rw-r--r--apps/theming/lib/Themes/DarkTheme.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/apps/theming/lib/Themes/DarkTheme.php b/apps/theming/lib/Themes/DarkTheme.php
index bd1d240a82c..83d54170e64 100644
--- a/apps/theming/lib/Themes/DarkTheme.php
+++ b/apps/theming/lib/Themes/DarkTheme.php
@@ -58,6 +58,10 @@ class DarkTheme extends DefaultTheme implements ITheme {
$colorBoxShadowRGB = join(',', $this->util->hexToRGB($colorBoxShadow));
$colorPrimaryLight = $this->util->mix($this->primaryColor, $colorMainBackground, -80);
+ // Background is _not_ bright
+ $colorPrimaryElement = $this->util->elementColor($this->primaryColor, false);
+ $colorPrimaryElementLight = $this->util->mix($colorPrimaryElement, $colorMainBackground, -80);
+
return array_merge($defaultVariables, [
'--color-main-text' => $colorMainText,
'--color-main-background' => $colorMainBackground,
@@ -75,9 +79,15 @@ class DarkTheme extends DefaultTheme implements ITheme {
'--color-primary-hover' => $this->util->mix($this->primaryColor, $colorMainBackground, 60),
'--color-primary-light' => $colorPrimaryLight,
'--color-primary-light-hover' => $this->util->mix($colorPrimaryLight, $colorMainText, 90),
- '--color-primary-element' => $this->util->elementColor($this->primaryColor, false),
- '--color-primary-element-hover' => $this->util->mix($this->util->elementColor($this->primaryColor, false), $colorMainBackground, 80),
- '--color-primary-element-light' => $this->util->lighten($this->util->elementColor($this->primaryColor, false), 15),
+
+ // used for buttons, inputs...
+ '--color-primary-element' => $colorPrimaryElement,
+ '--color-primary-element-text' => $this->util->invertTextColor($colorPrimaryElement) ? '#000000' : '#ffffff',
+ '--color-primary-element-hover' => $this->util->mix($colorPrimaryElement, $colorMainBackground, 60),
+ '--color-primary-element-light' => $colorPrimaryElementLight,
+ '--color-primary-element-light-text' => $colorPrimaryElement,
+ '--color-primary-element-light-hover' => $this->util->mix($colorPrimaryElementLight, $colorMainText, 90),
+ '--color-primary-element-text-dark' => $this->util->lighten($this->util->invertTextColor($colorPrimaryElement) ? '#000000' : '#ffffff', 7),
'--color-text-maxcontrast' => $this->util->darken($colorMainText, 30),
'--color-text-light' => $this->util->darken($colorMainText, 10),