Browse Source

enh(theming): Error contrast

Signed-off-by: Christopher Ng <chrng8@gmail.com>
pull/38211/head
Christopher Ng 3 years ago
parent
commit
27ebaea10c
  1. 1
      apps/theming/css/default.css
  2. 7
      apps/theming/lib/Themes/DarkTheme.php
  3. 11
      apps/theming/lib/Themes/DefaultTheme.php

1
apps/theming/css/default.css

@ -20,6 +20,7 @@
--color-error: #e9322d;
--color-error-rgb: 233,50,45;
--color-error-hover: #ed5a56;
--color-error-text: #e7201b;
--color-warning: #eca700;
--color-warning-rgb: 236,167,0;
--color-warning-hover: #efb832;

7
apps/theming/lib/Themes/DarkTheme.php

@ -59,6 +59,8 @@ class DarkTheme extends DefaultTheme implements ITheme {
$colorBoxShadow = $this->util->darken($colorMainBackground, 70);
$colorBoxShadowRGB = join(',', $this->util->hexToRGB($colorBoxShadow));
$colorError = '#e9322d';
return array_merge(
$defaultVariables,
$this->generatePrimaryVariables($colorMainBackground, $colorMainText),
@ -82,6 +84,11 @@ class DarkTheme extends DefaultTheme implements ITheme {
'--color-text-light' => $this->util->darken($colorMainText, 10),
'--color-text-lighter' => $this->util->darken($colorMainText, 20),
'--color-error' => $colorError,
'--color-error-rgb' => join(',', $this->util->hexToRGB($colorError)),
'--color-error-hover' => $this->util->mix($colorError, $colorMainBackground, 60),
'--color-error-text' => $this->util->lighten($colorError, 3),
// used for the icon loading animation
'--color-loading-light' => '#777',
'--color-loading-dark' => '#CCC',

11
apps/theming/lib/Themes/DefaultTheme.php

@ -109,6 +109,8 @@ class DefaultTheme implements ITheme {
$colorBoxShadow = $this->util->darken($colorMainBackground, 70);
$colorBoxShadowRGB = join(',', $this->util->hexToRGB($colorBoxShadow));
$colorError = '#e9322d';
$variables = [
'--color-main-background' => $colorMainBackground,
'--color-main-background-rgb' => $colorMainBackgroundRGB,
@ -137,10 +139,11 @@ class DefaultTheme implements ITheme {
'--color-scrollbar' => 'rgba(' . $colorMainTextRgb . ', .15)',
// info/warning/success feedback colours
'--color-error' => '#e9322d',
'--color-error-rgb' => join(',', $this->util->hexToRGB('#e9322d')),
'--color-error-hover' => $this->util->mix('#e9322d', $colorMainBackground, 60),
// error/warning/success/info feedback colours
'--color-error' => $colorError,
'--color-error-rgb' => join(',', $this->util->hexToRGB($colorError)),
'--color-error-hover' => $this->util->mix($colorError, $colorMainBackground, 60),
'--color-error-text' => $this->util->darken($colorError, 4),
'--color-warning' => '#eca700',
'--color-warning-rgb' => join(',', $this->util->hexToRGB('#eca700')),
'--color-warning-hover' => $this->util->mix('#eca700', $colorMainBackground, 60),

Loading…
Cancel
Save