aboutsummaryrefslogtreecommitdiffstats
path: root/apps/theming/lib
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2023-12-22 01:18:55 +0100
committerEduardo Morales <emoral435@gmail.com>2023-12-22 14:05:42 -0600
commita782d6f79781f4c71acd765126ccc131fa89f8e3 (patch)
treeff7b8dfbe7b7734882fd30a03b51485229739fa5 /apps/theming/lib
parentc7ada651a9ab6d1310209906d1babd0a328b2806 (diff)
downloadnextcloud-server-a782d6f79781f4c71acd765126ccc131fa89f8e3.tar.gz
nextcloud-server-a782d6f79781f4c71acd765126ccc131fa89f8e3.zip
fix(theming): Adjust high contrast theme to fulfill WCAG AAA text contrast
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/theming/lib')
-rw-r--r--apps/theming/lib/Themes/HighContrastTheme.php34
1 files changed, 31 insertions, 3 deletions
diff --git a/apps/theming/lib/Themes/HighContrastTheme.php b/apps/theming/lib/Themes/HighContrastTheme.php
index 1599d45e475..f02a30a7cb8 100644
--- a/apps/theming/lib/Themes/HighContrastTheme.php
+++ b/apps/theming/lib/Themes/HighContrastTheme.php
@@ -59,17 +59,25 @@ class HighContrastTheme extends DefaultTheme implements ITheme {
$colorMainBackground = '#ffffff';
$colorMainBackgroundRGB = join(',', $this->util->hexToRGB($colorMainBackground));
+ $colorError = '#D10000';
+ $colorWarning = '#995900';
+ $colorSuccess = '#207830';
+ $colorInfo = '#006DA8';
+
+ $primaryVariables = $this->generatePrimaryVariables($colorMainBackground, $colorMainText, true);
return array_merge(
$defaultVariables,
- $this->generatePrimaryVariables($colorMainBackground, $colorMainText),
+ $primaryVariables,
[
+ '--color-primary-element-text-dark' => $primaryVariables['--color-primary-element-text'],
+
'--color-main-background' => $colorMainBackground,
'--color-main-background-rgb' => $colorMainBackgroundRGB,
'--color-main-background-translucent' => 'rgba(var(--color-main-background-rgb), 1)',
'--color-main-text' => $colorMainText,
- '--color-background-dark' => $this->util->darken($colorMainBackground, 30),
- '--color-background-darker' => $this->util->darken($colorMainBackground, 30),
+ '--color-background-dark' => $this->util->darken($colorMainBackground, 20),
+ '--color-background-darker' => $this->util->darken($colorMainBackground, 20),
'--color-main-background-blur' => $colorMainBackground,
'--filter-background-blur' => 'none',
@@ -82,6 +90,26 @@ class HighContrastTheme extends DefaultTheme implements ITheme {
'--color-text-light' => $colorMainText,
'--color-text-lighter' => $colorMainText,
+ '--color-error' => $colorError,
+ '--color-error-rgb' => join(',', $this->util->hexToRGB($colorError)),
+ '--color-error-hover' => $this->util->darken($colorError, 8),
+ '--color-error-text' => $this->util->darken($colorError, 17),
+
+ '--color-warning' => $colorWarning,
+ '--color-warning-rgb' => join(',', $this->util->hexToRGB($colorWarning)),
+ '--color-warning-hover' => $this->util->darken($colorWarning, 7),
+ '--color-warning-text' => $this->util->darken($colorWarning, 13),
+
+ '--color-info' => $colorInfo,
+ '--color-info-rgb' => join(',', $this->util->hexToRGB($colorInfo)),
+ '--color-info-hover' => $this->util->darken($colorInfo, 7),
+ '--color-info-text' => $this->util->darken($colorInfo, 15),
+
+ '--color-success' => $colorSuccess,
+ '--color-success-rgb' => join(',', $this->util->hexToRGB($colorSuccess)),
+ '--color-success-hover' => $this->util->darken($colorSuccess, 7),
+ '--color-success-text' => $this->util->darken($colorSuccess, 14),
+
'--color-scrollbar' => $this->util->darken($colorMainBackground, 25),
// used for the icon loading animation