Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add color variables for text on blurred background
Signed-off-by: Christopher Ng <[email protected]>
  • Loading branch information
Pytal authored and backportbot-nextcloud[bot] committed Oct 12, 2022
commit 8caffb784ff34bfd25148db82b97c07446f0f081
2 changes: 2 additions & 0 deletions apps/theming/css/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
--color-placeholder-dark: #cccccc;
--color-main-text: #222222;
--color-text-maxcontrast: #767676;
--color-text-maxcontrast-default: #767676;
--color-text-maxcontrast-background-blur: #646464;
--color-text-light: #222222;
--color-text-lighter: #767676;
--color-scrollbar: rgba(34,34,34, .15);
Expand Down
1 change: 1 addition & 0 deletions apps/theming/lib/Themes/DarkHighContrastTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public function getCSSVariables(): array {
'--color-placeholder-dark' => $this->util->lighten($colorMainBackground, 45),

'--color-text-maxcontrast' => $colorMainText,
'--color-text-maxcontrast-background-blur' => $colorMainText,
'--color-text-light' => $colorMainText,
'--color-text-lighter' => $colorMainText,

Expand Down
5 changes: 4 additions & 1 deletion apps/theming/lib/Themes/DarkTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public function getCSSVariables(): array {
$colorMainText = '#D8D8D8';
$colorMainBackground = '#171717';
$colorMainBackgroundRGB = join(',', $this->util->hexToRGB($colorMainBackground));
$colorTextMaxcontrast = $this->util->darken($colorMainText, 30);

$colorBoxShadow = $this->util->darken($colorMainBackground, 70);
$colorBoxShadowRGB = join(',', $this->util->hexToRGB($colorBoxShadow));
Expand All @@ -75,7 +76,9 @@ public function getCSSVariables(): array {
'--color-placeholder-light' => $this->util->lighten($colorMainBackground, 10),
'--color-placeholder-dark' => $this->util->lighten($colorMainBackground, 20),

'--color-text-maxcontrast' => $this->util->darken($colorMainText, 30),
'--color-text-maxcontrast' => $colorTextMaxcontrast,
'--color-text-maxcontrast-default' => $colorTextMaxcontrast,
'--color-text-maxcontrast-background-blur' => $this->util->lighten($colorTextMaxcontrast, 2),
'--color-text-light' => $this->util->darken($colorMainText, 10),
'--color-text-lighter' => $this->util->darken($colorMainText, 20),

Expand Down
5 changes: 4 additions & 1 deletion apps/theming/lib/Themes/DefaultTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public function getMediaQuery(): string {
public function getCSSVariables(): array {
$colorMainText = '#222222';
$colorMainTextRgb = join(',', $this->util->hexToRGB($colorMainText));
$colorTextMaxcontrast = $this->util->lighten($colorMainText, 33);
$colorMainBackground = '#ffffff';
$colorMainBackgroundRGB = join(',', $this->util->hexToRGB($colorMainBackground));
$colorBoxShadow = $this->util->darken($colorMainBackground, 70);
Expand Down Expand Up @@ -126,7 +127,9 @@ public function getCSSVariables(): array {

// max contrast for WCAG compliance
'--color-main-text' => $colorMainText,
'--color-text-maxcontrast' => $this->util->lighten($colorMainText, 33),
'--color-text-maxcontrast' => $colorTextMaxcontrast,
'--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),

Expand Down
1 change: 1 addition & 0 deletions apps/theming/lib/Themes/HighContrastTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public function getCSSVariables(): array {
'--color-placeholder-dark' => $this->util->darken($colorMainBackground, 45),

'--color-text-maxcontrast' => $colorMainText,
'--color-text-maxcontrast-background-blur' => $colorMainText,
'--color-text-light' => $colorMainText,
'--color-text-lighter' => $colorMainText,

Expand Down