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

Improve the "Add title..." and "Write" placeholders color contrast ratio #1302

Closed
afercia opened this issue Jun 20, 2017 · 5 comments
Closed
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Good First Issue An issue that's suitable for someone looking to contribute for the first time

Comments

@afercia
Copy link
Contributor

afercia commented Jun 20, 2017

The new "Write placeholders" have an insufficient color contrast ratio. To be compliant with the WCAG at level AA, text should have a contrast ratio of at least 4.5:1 with its background.

screen shot 2017-06-20 at 14 20 37

screen shot 2017-06-20 at 14 20 54

If I'm not wrong, the current color is #ccd0d4 and gives a result of:
Luminosity Contrast Ratio: 1.55:1
https://jdlsn.com/color/?type=hex&color=ccd0d4&color2=ffffff

The only exception is when the text is bigger than approximately 24px or bigger than approximately 18.5px and bold: in this case, the required contrast ratio threshold lowers to 3:1.

The "Add title..." placeholder has a (computed) font-size of 32px but the color contrast ratio is just 2.93:1 and should be at least 3:1.

Note on colors:
I guess colors should be picked up from the new ones designed by @hugobaeta, https://codepen.io/hugobaeta/pen/grJjVp not sure #ccd0d4 is there. I see the implementation sometimes uses a CSS generated content and sometimes a placeholder attribute, that's perfectly fine but worth nothing the current styling for the placeholder attribute is overriding the rules provided by core:

screen shot 2017-06-20 at 14 32 51

they were introduced in https://core.trac.wordpress.org/changeset/36619 for good reasons. Maybe worth considering updating the core rules with a new (and accessible) shade of gray.

@afercia afercia added the [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). label Jun 20, 2017
@jasmussen
Copy link
Contributor

Nice. Looking at https://github.com/WordPress/gutenberg/blob/master/editor/assets/stylesheets/_variables.scss, what would be the lightest Hugo gray that would pass the test?

@afercia
Copy link
Contributor Author

afercia commented Jun 21, 2017

Against a white background, I think it's #6c7781 which gives a 4.57:1 contrast ratio:
https://jdlsn.com/color/?type=hex&color=6c7781&color2=ffffff

@jasmussen
Copy link
Contributor

jasmussen commented Jun 21, 2017

I could accept that, but wouldn't #7e8993 work also? https://www.joedolson.com/tools/color-contrast.php?type=hex&color=%237e8993&color2=%23ffffff&alpha=1 — that gives a > 3:1 contrast ratio, which you suggest should be the least.

I suggest this lighter color not for the visuals, but rather, I'd like for it to truly look like placeholder text, and not be confused with actual text, and the lighter we can make it, the better for that. If #7e8993 passes, even if not with flying colors (pardon the pun), I'd vote for that.

@afercia
Copy link
Contributor Author

afercia commented Jun 21, 2017

A 3:1 contrast ratio conforms to the WCAG level AA only for text bigger than 24px or 18.5px bold. So, #7e8993 is OK for the big "Add title..." but not sufficient for the smaller "Write your story/Write".

@jasmussen
Copy link
Contributor

Ah understood.

@jasmussen jasmussen added the Good First Issue An issue that's suitable for someone looking to contribute for the first time label Jun 21, 2017
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). Good First Issue An issue that's suitable for someone looking to contribute for the first time
Projects
None yet
Development

No branches or pull requests

2 participants