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

Does not count gradient as a background color #5

Open
snorrekim opened this issue Jun 9, 2015 · 5 comments
Open

Does not count gradient as a background color #5

snorrekim opened this issue Jun 9, 2015 · 5 comments
Labels

Comments

@snorrekim
Copy link

Css for the button (it's a <a>):
image

tota11y's reaction
image

I don't know if you have a "warning" type. But, as this is kind of hard to know programatically, maybe cases like this should check all colors used in the gradient, then, if only some of those colors are below contrast ratio you should get a warning.

Don't know if it matters, but linear-gradient might actually be defined as background-image:
image

@jdan
Copy link
Owner

jdan commented Jun 9, 2015

There is no feasible way to check for the gradient programmatically, but the color error should still be valid because it falls under the same category as having an image there.

The way I see it is - if the background image didn't load (or if the gradient wasn't supported in that browser), the user would see the button's background-color. In this case, white, which fails a contrast check. In short, there should be an explicit background color on this button (even if the gradient overrides it) that has viable contrast. Scratch this, we're not reading the background-color if there's a gradient there.

Would be nice to communicate this to the user, though. Perhaps check for background-image and modify the error message to include the info I just wrote above?

@snorrekim
Copy link
Author

Oh. I forgot to mention. If you look at the css it does have an explicit
fallback background color that is valid. (it's strikes out because chrome
is is using background-image insted). So I guess that might be a bug?

But yeah if you can't check for the gradient colors, at least a check for
background-image with an explanation would be good. The explenations are
one of the great strengths of this project.
On 9 Jun 2015 17:04, "Jordan Scales" notifications@github.com wrote:

There is no feasible way to check for the gradient programmatically, but
the color error should still be valid because it falls under the same
category as having an image there.

The way I see it is - if the background image didn't load (or if the
gradient wasn't supported in that browser), the user would see the button's
background-color. In this case, white, which fails a contrast check. In
short, there should be an explicit background color on this button (even if
the gradient overrides it) that has viable contrast.

Would be nice to communicate this to the user, though. Perhaps check for
background-image and modify the error message to include the info I just
wrote above?


Reply to this email directly or view it on GitHub
#5 (comment).

@jdan
Copy link
Owner

jdan commented Jun 9, 2015

Oh, my mistake, you're absolutely right. Checking either end of the gradient is probably the best we can do.

@jdan
Copy link
Owner

jdan commented Jun 9, 2015

I went ahead and filed the first bit - descriptive error messages for background images - as its own issue in #6.

@jdan
Copy link
Owner

jdan commented Jun 11, 2015

GoogleChrome/accessibility-developer-tools#79

May need to leave it up to them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants