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

fix($theme-default): improve last-updated text color contrast #2282

Merged
merged 1 commit into from Jul 25, 2020
Merged

fix($theme-default): improve last-updated text color contrast #2282

merged 1 commit into from Jul 25, 2020

Conversation

cyrilf
Copy link
Contributor

@cyrilf cyrilf commented Apr 5, 2020

Summary

On the .last-updated .time element, the color contrast is too low which raised an accessibility warning in a Lighthouse report.

Here is a minor tweak of the color to fix that.

It won't affect much the end user, but provides:

  • a more accessible website 🎉
  • a better lighthouse accessibility score by default 👌

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Other, please describe:
    Style

If changing the UI of default theme, please provide the before/after screenshot:

Before After
Screenshot Screenshot from 2020-04-05 19-21-41 Screenshot from 2020-04-05 19-22-18
Chrome contrast ratio Screenshot from 2020-04-05 19-23-42 Screenshot from 2020-04-05 19-23-26

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)

You have tested in the following browsers: (Providing a detailed version will be better.)

  • Chrome
  • Firefox
  • Safari
  • Edge
  • IE

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature
  • Related documents have been updated
  • Related tests have been updated

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

If we want to support a contrast ratio AAA we would need to update the color to at least: #595959. But the end result doesn't work as the time seems as black as the text. That's why, going for a contrast ratio AA is sufficient.

On the `.last-updated .time` element, the color contrast is too low which raised an accessibility warning in a Lighthouse report.
Minor tweak of the color to fix that.
@billyyyyy3320 billyyyyy3320 changed the title style($theme-default): improve accessibility color feat($theme-default): improve last-updated text color contrast Apr 11, 2020
@billyyyyy3320
Copy link
Collaborator

Thanks! I changed the title since we use style as code style update.

@cyrilf
Copy link
Contributor Author

cyrilf commented Apr 11, 2020

Yes ok, got it! 👍

@Mister-Hope
Copy link
Contributor

#2301 has adjust the color.

See here

Do you think it's still light now?

@cyrilf
Copy link
Contributor Author

cyrilf commented Apr 14, 2020

@Mister-Hope yep, on your PR the contrast is still too low to reach the accessibility standard.

Screenshot from 2020-04-14 19-00-12

If you use Chrome, simply open the dev tools, find the color in the css and click on the colored square. You'll see the contrast ratio (that you can expend) and see if it matches the minimum ratio. (as in the above screenshot)

So the minimum value is still #767676 and my PR still applies.
Your --light-grey should be of this value minimum.

@Mister-Hope
Copy link
Contributor

Thanks, I will make a commit later.

@meteorlxy
Copy link
Member

@newsbielt703 I prefer to take this PR as a perf or fix 🤔

@billyyyyy3320 billyyyyy3320 changed the title feat($theme-default): improve last-updated text color contrast fix($theme-default): improve last-updated text color contrast Apr 15, 2020
@billyyyyy3320
Copy link
Collaborator

@meteorlxy Yeah it should be.

@kefranabg kefranabg merged commit 7ca9fbc into vuejs:master Jul 25, 2020
@cyrilf cyrilf deleted the patch-1 branch August 3, 2020 10:44
larionov pushed a commit to larionov/vuepress that referenced this pull request Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants