-
Notifications
You must be signed in to change notification settings - Fork 203
Fix Caps-lock-is-on color in light theme #4320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Caps-lock-is-on color in light theme #4320
Conversation
|
Actually, contrast actually needs between non-large text and background needs to be 4.5:1. Shall we use the text colour, instead of hardcoding black? |
33b6a86 to
97fff26
Compare
|
@juanruitina Fixed the value. About using the text color, the problem is that the "warning_bg_color" and the "warning_color" are defined much before the current text color is defined... |
|
Also, did a change, because I realized that only the color for the text should be changed... |
|
Is this affecting upstream too? If so, let's handle that there. Otherwise, please add a comment to mention that this is a yaru-diff |
|
It only affects Yaru. In Gnome theme, the dialog is always dark, no matter if the style is dark or light, so the yellow always works fine. I'll add a comment in the description. |
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.
01f6de5 to
bb6c5bd
Compare
I see, however it seems the change is too generic, as the colors should be kept as they are, and in case we should override them in the dialogs |
gnome-shell/upstream/theme/gnome-shell-sass/_default-colors.scss
Outdated
Show resolved
Hide resolved
I'm fine using a valid contrast color, but I don't think black is the right one here, especially since it can be potentially be re-used in other places. To get a properly contrasted color, @sergio-costas, you can generate one using the |
|
@3v1n0 I disagree on this one. I do think we should use same colour as body text here as the simplest solution. There's no such thing as dark yellow, brown doesn't carry sufficient semantic meaning, and orange can't be used as a semantic colour in Ubuntu for obvious reasons. |
Yeah, that's nicer IMHO, although we should fix the colors there too, to have proper contrast. |
|
I'm OK with using that background if we want to preserve semantic colour. Text colour needs to be darkened so it provides at least 4.5:1 contrast on that light yellow background. (Using darkened yellow is fine for text as long as there's a proper yellow background) |
|
@juanruitina Mmm... so then, adding a "warning_bg_color" and using normal text color and that "warning_bg_color" in the dialog...? That would require one patch for yaru, and another for gnome shell... |
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.
bb6c5bd to
bd78d4b
Compare
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.
bd78d4b to
e4353f5
Compare
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.
e4353f5 to
16479b9
Compare
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 litgh 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 the normal text color in light themes.
36d277f to
96e87e2
Compare
|
Thanks the change is better, I think we should discuss this upstream though, since it's affecting both (I mean light theme is not default, but it can be enabled there too). And I'd still go using the background in both cases as done for the logout. |
|
Thank you Sergio, this addresses the accessibility concerns. A quick mockup for comparison of the discussed options:
I darkened text yellow in the third option right on Figma for 4.5:1 contrast to
It would be great to look closer into this and come up with a consistent approach to alerts for both Yaru and Yaru.dart. |
|
Yeah, let me see where I can get... |
|
I much prefer having a background that darkening the yellow color. |
But in Gnome upstream the dialogs are always dark, no matter what theme is selected. |
|
Just as a clarification: I don't love that we use that darkened yellow alone because the semantics of it are barely noticeable and these tend to work better together with a more obviously yellow background, as discussed above; but it's an improvement because it's at least accessible. The accessibility bug is fixed, a nicer visual might be still worth exploring. |







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 litgh 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.