Skip to content

Commit

Permalink
Merge pull request #34567 from nextcloud/backport/34545/stable25
Browse files Browse the repository at this point in the history
[stable25] Disable translucency on high contrast themes
  • Loading branch information
szaimen authored Oct 13, 2022
2 parents 3993829 + 5e2c5e5 commit 1360771
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion apps/theming/lib/Themes/DarkHighContrastTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,15 @@ public function getCSSVariables(): array {

$colorMainText = '#ffffff';
$colorMainBackground = '#000000';
$colorMainBackgroundRGB = join(',', $this->util->hexToRGB($colorMainBackground));

return array_merge(
$defaultVariables,
$this->generatePrimaryVariables($colorMainBackground, $colorMainText),
[
'--color-main-background' => $colorMainBackground,
'--color-main-background-translucent' => 'rgba(var(--color-main-background-rgb), .1)',
'--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->lighten($colorMainBackground, 30),
Expand Down
4 changes: 3 additions & 1 deletion apps/theming/lib/Themes/HighContrastTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,15 @@ public function getCSSVariables(): array {

$colorMainText = '#000000';
$colorMainBackground = '#ffffff';
$colorMainBackgroundRGB = join(',', $this->util->hexToRGB($colorMainBackground));

return array_merge(
$defaultVariables,
$this->generatePrimaryVariables($colorMainBackground, $colorMainText),
[
'--color-main-background' => $colorMainBackground,
'--color-main-background-translucent' => 'rgba(var(--color-main-background-rgb), .1)',
'--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),
Expand Down

0 comments on commit 1360771

Please sign in to comment.