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

Tweak colour contrast #392

Merged
merged 7 commits into from
Mar 17, 2022
Merged

Tweak colour contrast #392

merged 7 commits into from
Mar 17, 2022

Conversation

hidde
Copy link
Member

@hidde hidde commented Mar 15, 2022

Building on this PR for the dev edition, this PR updates some colours in the regular spec layout to help meet WCAG.

I have tried to find all instances of these colours in the repo to try and update them all (except for the mailing list entries and temporary files).

This updates colour contrast of:

  • orangered on white, changing to #d5430c (sorry, I could not find named colour), improving contrast from 3.44 : 1 to 4.91 : 1
  • gray backgrounds in notes and MDN annotation from #EEE to #f5f5f5, consistent with update in dev edition, bumping contrast from 4.19 : 1 to 4.54 : 1 / 4.8 : 1 (MDN annotation)

comparing mdn badge, the one on the right has a lighter gray background

comparing code examples, the one on the right has a lighter gray background

comparing lists of properties, the one on the right uses less bright orange in linked property names

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

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

Thank you for tackling this! Does this resolve #262 in its entirety or is it just a start?

I wonder if we should document these colors somewhere now they're less memorable, but copy-and-paste is probably good enough for now.

Optional nit: use consistent casing for hex digits.

https://github.com/whatwg/blog.whatwg.org/blob/main/org.whatwg.awesome/style.css also needs to be patched.

resources.whatwg.org/standard-shared-with-dev.css Outdated Show resolved Hide resolved
@hidde
Copy link
Member Author

hidde commented Mar 16, 2022

Thanks for the quick reply! Have fixed the casing and found one more combination I missed (warnings; thanks, Steve). I believe with that, this PR fixes the colour issues in the specs, with the exception of syntax highlighting.

I planned to do a separate PR for syntax colours, I wonder if that should be in https://github.com/tabatkins/highlighter/blob/master/highlighter/styles.py though? Or even in Bikeshed? I am not super familiar with either, but would suggest we use the colours from a11y-syntax-highlighting, which is a set of matching colours that meet WCAG.

Would be happy to also submit a PR for the blog (it seems to be down at the moment?), and maybe also for a page that lists the colours somewhere, not sure where is a good location for that?

@annevk
Copy link
Member

annevk commented Mar 16, 2022

For highlight: I think tabatkins/highlighter makes sense (cc @tabatkins) and if you update that I suspect Bikeshed will inherit those fixes. For WHATWG we have a copy of those rules in resources.whatwg.org/standard-shared-with-dev.css so that would have to be updated as well.

Blog: yeah, the hosting situation is not ideal at the moment: whatwg/misc-server#163. When it is up however it does use similar styles to the website and specifications so probably needs some adjusting too.

Listing colors: I think it would make some sense to put these on https://whatwg.org/style-guide if we wanted to document them. Not a 100% sure though. Perhaps we should leave this for now. @domenic thoughts?

resources.whatwg.org/standard.css Outdated Show resolved Hide resolved
resources.whatwg.org/standard.css Outdated Show resolved Hide resolved
resources.whatwg.org/standard.css Outdated Show resolved Hide resolved
resources.whatwg.org/standard.css Outdated Show resolved Hide resolved
@domenic
Copy link
Member

domenic commented Mar 16, 2022

Listing colors: I think it would make some sense to put these on https://whatwg.org/style-guide if we wanted to document them. Not a 100% sure though. Perhaps we should leave this for now. @domenic thoughts?

I think we can leave it out for now. In the future we should consider consolidating things into CSS variables, maybe a shared style sheet of some sorts, etc. But adding another location to keep in sync seems slightly counterproductive.

@tabatkins
Copy link
Contributor

For highlight: I think tabatkins/highlighter makes sense (cc @tabatkins) and if you update that I suspect Bikeshed will inherit those fixes.

The inheritance won't be automatic, but yes, I'll keep them in sync. Happy to have a discussion about colors used; I just grabbed the palette I liked from https://prismjs.com/. Please open an issue!

@hidde
Copy link
Member Author

hidde commented Mar 16, 2022

Thanks @tabatkins, I have opened tabatkins/highlighter#25.

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

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

I undid the changes to whatwg.org/style/specification as it shouldn't be used anymore and I rather not change historical files. I'll also create a PR for content-venn.svg against the whatwg/html repository to match this change here.

@annevk annevk merged commit 4e03c7a into whatwg:main Mar 17, 2022
@annevk
Copy link
Member

annevk commented Mar 17, 2022

@hidde thanks for catching those additional red cases, it's much appreciated!

annevk added a commit to whatwg/html that referenced this pull request Mar 17, 2022
Remove .glyph.control as the named character references table does not contain code points in the range U+0000 to U+0020, inclusive.

See whatwg/whatwg.org#392 for context.
@hidde
Copy link
Member Author

hidde commented Mar 17, 2022

Thanks, that makes sense! Thanks also for the content-venn change, had missed it was also in whatwg/html.

Appreciate the quick responses on this PR, will be in touch for the syntax highlight changes!

annevk added a commit to whatwg/html that referenced this pull request Mar 17, 2022
@hidde hidde deleted the increase-color-contrast branch March 17, 2022 08:47
annevk added a commit to whatwg/html that referenced this pull request Mar 17, 2022
mfreed7 pushed a commit to mfreed7/html that referenced this pull request Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants