Skip to content
This repository has been archived by the owner on Dec 1, 2019. It is now read-only.

Add a11y friendly default text-colors when selecting a background-color. #995

Merged
merged 7 commits into from
Nov 12, 2019

Conversation

allancole
Copy link
Contributor

Before:

2019-11-11 16 49 24

After:

2019-11-11 16 48 14

Related Tickets

Fixes: #964

@joyously
Copy link

Don't the color settings change in the palette when you change the colors in the Customizer?
So setting the text color is only good for the defaults?
Wouldn't it be better to make the text color work regardless of background color?

@allancole
Copy link
Contributor Author

Group Blocks and any block that uses any of the .has-background-xxxxxxx-color utility classes are also fixed with this PR. Here’s a gif of it working with this fix:

2019-11-11 17 03 36

@mapk
Copy link

mapk commented Nov 11, 2019

I just tested this in FF 70.0.1 and am seeing the a11y warning still. Is this right?

contrast 2019-11-11 14_32_50

@mapk
Copy link

mapk commented Nov 11, 2019

So double checking the contrast on these color combinations:

  • RED (#cd2653) & WHITE (#FFF) – 5.25 contrast ratio
  • BLACK (#000) & TAN (#f5efe0) – 18.30 contrast ratio
  • DARK GRAY (#6d6d6d) & WHITE (#FFF) – 5.17 contrast ratio

Looks like something may be off with the contrast warning in Gutenberg?

@joyously
Copy link

I tried it with changed colors.
Peek 2019-11-11 16-48

@karmatosed karmatosed self-requested a review November 11, 2019 23:37
Copy link
Contributor

@audrasjb audrasjb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I just spotted a very minor coding standard issue.
I commented in the PR.
Cheers,
Jb

style-rtl.css Outdated
@@ -2664,6 +2666,7 @@ h2.entry-title {

:root .has-secondary-background-color {
background-color: #6d6d6d;
color: #FFF;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding standards: should be #fff for consistency.

@audrasjb
Copy link
Contributor

Hi,
For what it worth, I tested the PR on my side, and it looks good to me.
Changing background color is automatically changing the font color when needed.

@audrasjb
Copy link
Contributor

5e7ff2db531ab3c9150268adb25fc914

@karmatosed karmatosed merged commit 157a899 into WordPress:master Nov 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Selecting a Background Color preset for the Group block should automatically change the text color
5 participants