Skip to content

Commit 9917893

Browse files
committed
gnome-shell: Optimize contrast for warning, success and destructive texts
In practice the shell only use the warning color, but optimize them all in case some extension relies on the other ones (yep, ubuntu-dock!)
1 parent 0ab90c2 commit 9917893

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

gnome-shell/src/gnome-shell-sass/_yaru-colors.scss

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import 'sass-utils';
2+
13
// Yaru custom definitions
24
$base_hover_color: transparentize(white, 0.8);
35
$base_active_color: transparentize(white, 0.75);
@@ -35,3 +37,19 @@ $osd_insensitive_bg_color: transparentize(mix($osd_fg_color, opacify($osd_bg_col
3537
$osd_insensitive_fg_color: mix($osd_fg_color, opacify($osd_bg_color, 1), 50%);
3638
$osd_borders_color: transparentize(black, 0.3);
3739
$osd_outer_borders_color: transparentize(white, 0.84);
40+
41+
// Overrides defaults for contrast optimized ones.
42+
43+
// colors for destructive elements
44+
$destructive_bg_color: optimize-contrast($destructive_fg_color, $red, $target: 5.5);
45+
$destructive_color: optimize-contrast($bg_color, $red, $target: 6.0);
46+
47+
// colors for levelbars, entries, labels and infobars
48+
$success_bg_color: optimize-contrast($success_fg_color, $green, $target: 5.5);
49+
$success_color: optimize-contrast($bg_color, $green, $target: 6.0);
50+
51+
$warning_bg_color: optimize-contrast($warning_fg_color, $yellow, $target: 5.5);
52+
$warning_color: optimize-contrast($bg_color, $yellow, $target: 6.0);
53+
54+
$error_bg_color: optimize-contrast($error_fg_color, $red, $target: 5.5);
55+
$error_color: optimize-contrast($bg_color, $red, $target: 6.0);

gnome-shell/src/gnome-shell-sass/_yaru-default-colors.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,3 @@ $_base_color_light: $light_1; // Yaru: use our colors
44

55
// Used for dash and other dark elements on light theme
66
$yaru_borders_color_dark: lighten(desaturate(lighten($jet, 4%), 100%), 14%);
7-
8-
// Overrides default
9-
$warning_bg_color: if($variant =='light', darken($yellow, 1%), $yellow);

gnome-shell/src/gnome-shell-sass/widgets/_osd.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/* OSD */
22

3+
@import 'sass-utils';
4+
35
$osd_levelbar_height:6px;
46

57
.osd-window {
@@ -27,7 +29,8 @@ $osd_levelbar_height:6px;
2729
-barlevel-height: $osd_levelbar_height;
2830
-barlevel-background-color: transparentize($osd_fg_color, if($variant=='light', 0.7, 0.9));
2931
-barlevel-active-background-color: $osd_fg_color;
30-
-barlevel-overdrive-color: $destructive_color;
32+
// Yaru: Optimize overdrive color for contrast
33+
-barlevel-overdrive-color: optimize-contrast($osd_bg_color, $destructive_color, $target: 5.5);
3134
-barlevel-overdrive-separator-width: $base_padding * 0.5;
3235
&:ltr { margin-right: $base_padding; }
3336
&:rtl { margin-left: $base_padding; }

0 commit comments

Comments
 (0)