-
Notifications
You must be signed in to change notification settings - Fork 19
Palette wcag review #154
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
base: main
Are you sure you want to change the base?
Palette wcag review #154
Conversation
|
closing PR to refresh the diff file, will reopen |
|
didn't work, will try again but update the base while PR is closed |
|
can't change the base branch while the PR is closed; reopening |
|
hi @cowellbunga in meantime i will take a look at the test script |
| value = "ffffff" | ||
| if any(x in label for x in bg_labels): | ||
| backgrounds[label] = value | ||
| else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you explain more what is going on this else block (54-60)? i am a bit lost
how do we end up making use of the color_labels list from matplotlib?
i tried out the Web AIM API with a hex value and one of the matplotlib color names and the result doesn't make sense to me
for example when i compare beige to burlywood
https://webaim.org/resources/contrastchecker/?fcolor=faf0e6&bcolor=burlywood&api
where beige hex is #faf0e6 i get all passes even though by my eye they seem very similar:
{"ratio":"18.4","AA":"pass","AALarge":"pass","AAA":"pass","AAALarge":"pass"}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comparing beige to the burlywood hexcode #deb887 fails:
https://webaim.org/resources/contrastchecker/?fcolor=faf0e6&bcolor=deb887&api:
{"ratio":"1.65","AA":"fail","AALarge":"fail","AAA":"fail","AAALarge":"fail"}so if we are using the matplotlib color label i think we need to look up the hex code first
(again, wasn't entirely sure just from reading)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The else block on lines 54-60 is just a basic way to filter for foreground labels or color labels (treated as foreground) within the palettes. This is the only place where the matplotlib color labels are used currently. I just added that as a hacky way to capture additional color labels from palettes, assuming that new palettes could be imported any time.
So you are correct that the review should only be using hex codes and I think that it will only do so as long as the palette css files follow the existing structure (color-name: #HEXVALUE).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also we can definitely remove the two elif statements if it is decided that all palette css files will follow the same naming convention, using "fg"/"foreground" and "bg"/"background" in the color labels. Other color types (ex: accents) could also be defined as needed.
Right now some palettes may include words like "primary", "secondary", tertiary", "color", or an actual color name (ex: "red") in the label instead of the foreground/background strings, so that is why the elif statements on lines 57-60 are currently used.
|
i like this so far i think it makes sense gruvbox_dark.css< <
|
… palette review href's to main page
I realized that having the palette review inside of utils caused the utils.html file to clash with an html package (used by palette review) of the same name. Moving the review script outside of the tests.utils package fixes the issue, removing the need for a name change. Name change reverted. |
Thank you in advance for helping us to improve Terminal for MkDocs
Please read through the template below and answer all relevant questions. Your additional work here is greatly appreciated and will help us respond as quickly as possible. To avoid duplicates, please search existing Issues before submitting one here.
By submitting a PR to this repository, you agree to the terms within the Terminal for MkDocs Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.
Description
This PR adds a palette review script to tests/utils that outputs a markdown report in tests/.
This PR also includes some new high contrast palettes to compare via the review script.
I also removed the comment lines from the gruvbox dark palette because it was breaking the process and it is the only palette like this.
Some minor changes were made to the test scripts. html.py has conflicts with the requests package, so it was renamed to html_utils.py. Also deleted the version line of the docker compose file because it was raising a warning.
References
This PR addresses #120 and #119 in an attempt to expand on the palette options and to expedite the palette review process.
Testing
Checklist