Skip to content
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

Improvements for the color contrast check against default theme colors. #6484

Closed
afercia opened this issue Apr 28, 2018 · 4 comments
Closed
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes).

Comments

@afercia
Copy link
Contributor

afercia commented Apr 28, 2018

Premise: I haven't looked at the code.

When setting the text color to a value that produces an insufficient contrast ratio with the default background color, there's no warning:

Custom text color vs. default background (white in this case):

screen shot 2018-04-28 at 16 09 04

Vice-versa, a custom background that produces an insufficient contrast ratio with the default text color, does show the warning:

screen shot 2018-04-28 at 16 09 45

It would be great to have the check work also with the default background color.

Also wondering what happens when in the future themes will be able to provide their own background / text colors, see for example #6404:

One long term vision for the editor, is to allow you to load the theme stylesheet into the editor canvas itself ...

@afercia afercia added the [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). label Apr 28, 2018
@jorgefilipecosta
Copy link
Member

jorgefilipecosta commented Apr 30, 2018

Hi @afercia, what happens is that by default the background of the paragraph is rgba( 0, 0, 0, 0) (totally transparent), we can not know what is, in fact, the background color. The theme may even set an image as background and we can not compute the right color. A block can also set a backrgound for nested paragraphs e.g: cover image. If the theme sets a background color e.g: white and correctly loads the styles, we will be able to shown warnings. But if no changes happen we can not make sure if the contrast is right or not.

For the text color, we show warning because at the start it is not transparent, by default we set a color.

@afercia
Copy link
Contributor Author

afercia commented Apr 30, 2018

Hi @jorgefilipecosta thanks, I understand a bit better now. Then if there are no reliable ways to detect the background color when blocks are transparent and the theme doesn't set a background color, please do feel free to close this issue,

@jorgefilipecosta
Copy link
Member

Unfortunately, it looks like in fact, right now we don't have a reliable way to detect what the background color (or colors) will end up being. So I'm closing this issue, for now, thank you for referring this issue.

@afercia
Copy link
Contributor Author

afercia commented May 1, 2018

For some background, see #5658 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes).
Projects
None yet
Development

No branches or pull requests

2 participants