aboutsummaryrefslogtreecommitdiffstats
path: root/apps/theming/lib
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2023-10-04 23:32:55 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2023-10-27 12:54:14 +0200
commit1c4787af849aac50eabb540da9ed51bf033afb4c (patch)
tree88e048ab8fc1ab05691063a101c011adf2b850c1 /apps/theming/lib
parentee1480cefc342578a2ee7539e4761abf59ac4a96 (diff)
downloadnextcloud-server-1c4787af849aac50eabb540da9ed51bf033afb4c.tar.gz
nextcloud-server-1c4787af849aac50eabb540da9ed51bf033afb4c.zip
fix(theming): Ensure that maxcontrast text has always a contrast of 4.5:1 even on hover
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/theming/lib')
-rw-r--r--apps/theming/lib/Themes/DefaultTheme.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/theming/lib/Themes/DefaultTheme.php b/apps/theming/lib/Themes/DefaultTheme.php
index 70a7b5fdff8..820291146bf 100644
--- a/apps/theming/lib/Themes/DefaultTheme.php
+++ b/apps/theming/lib/Themes/DefaultTheme.php
@@ -103,7 +103,8 @@ class DefaultTheme implements ITheme {
public function getCSSVariables(): array {
$colorMainText = '#222222';
$colorMainTextRgb = join(',', $this->util->hexToRGB($colorMainText));
- $colorTextMaxcontrast = $this->util->lighten($colorMainText, 33);
+ // Color that still provides enough contrast for text, so we need a ratio of 4.5:1 on main background AND hover
+ $colorTextMaxcontrast = '#707070'; // 4.54 : 1 for hover background
$colorMainBackground = '#ffffff';
$colorMainBackgroundRGB = join(',', $this->util->hexToRGB($colorMainBackground));
$colorBoxShadow = $this->util->darken($colorMainBackground, 70);
@@ -138,7 +139,7 @@ class DefaultTheme implements ITheme {
'--color-text-maxcontrast-default' => $colorTextMaxcontrast,
'--color-text-maxcontrast-background-blur' => $this->util->darken($colorTextMaxcontrast, 7),
'--color-text-light' => $colorMainText,
- '--color-text-lighter' => $this->util->lighten($colorMainText, 33),
+ '--color-text-lighter' => $this->util->lighten($colorMainText, 30),
'--color-scrollbar' => 'rgba(' . $colorMainTextRgb . ', .15)',