Skip to content

Commit 16479b9

Browse files
committed
Fix Caps-lock-is-on color in light theme #4320
When a Polkit dialog is open to ask for the password, if the user activates the Caps Lock, a message appears under the text entry notifying that it is active, to warn the user. In dark theme, this message is painted in yellow, which is fine because it gives a good contrast against the background; but in ligth theme, a slightly darker yellow is used, which has poor contrast. This goes against the accessibility (A11Y) requirements of having, at least, a 4.5/1 contrast ratio in text. This only happens in Yaru, because in upstream Gnome theme, the dialog is always dark, no matter what style (dark or light) is selected by the user. This patch fixes this by setting the WARNING text color to black in light themes.
1 parent ac30130 commit 16479b9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ $success_bg_color: if($variant == 'light', $green_4, $green_5);
1717
$success_fg_color: $light_1;
1818
$success_color: $success_bg_color;
1919

20-
$warning_bg_color: if($variant == 'light', black, #cd9309); // uses darker off-palette yellow
20+
$warning_bg_color: if($variant == 'light', $yellow_5, #cd9309); // uses darker off-palette yellow
2121
$warning_fg_color: transparentize(black, .2);
2222
$warning_color: $warning_bg_color;
2323

gnome-shell/upstream/theme/gnome-shell-sass/_default-colors.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ $success_bg_color: if($variant == 'light', $green_4, $green_5);
1717
$success_fg_color: $light_1;
1818
$success_color: $success_bg_color;
1919

20-
$warning_bg_color: if($variant == 'light', black, #cd9309); // uses darker off-palette yellow
20+
$warning_bg_color: if($variant == 'light', $yellow_5, #cd9309); // uses darker off-palette yellow
2121
$warning_fg_color: transparentize(black, .2);
22-
$warning_color: $warning_bg_color;
22+
$warning_color: if($variant == 'light', black, $warning_bg_color);
2323

2424
$error_bg_color: if($variant == 'light', $red_3, $red_4);
2525
$error_fg_color: $light_1;

0 commit comments

Comments
 (0)