CoreyGinnivan / whocanuse

WhoCanUse is a tool that brings attention and understanding to how color contrast can affect different people with visual impairments.
https://whocanuse.com/
MIT License
457 stars 48 forks source link

Have small font size better affect low vision types #11

Open CoreyGinnivan opened 4 years ago

samC3 commented 4 years ago

Hey guys, love this project! It's exactly what we need at work right now. I found it wasn't very obvious how the font field affects the final score, is this issue to adjust how font size works in the algorithm that decides the final rating?

I found the getWcagScore.js file which looks like it’s based on 1.4.6 of the WCAG spec? And I can see that the requirement to be over 15px in font size was dropped.

Really happy to help out with this issue if I can, just wondering what the thinking is to build out the enhancement?

CoreyGinnivan commented 4 years ago

I should have specified what this what relating to a bit more haha (still learning). This was to make the Low Vision, Cataracts and Glaucoma type be affected by smaller text (so it would fail under 12px or so).

The big reason for scrapping the font-size requirement was that it felt super wrong to have something that was very high contrast immediately fail everything if it was under 15px.

The WCAG spec is great most of the time, but some things just don't make too much sense.

But, you're right – it's just bare bones and based on the WCAG spec for now. We should be showing off the maths behind it a bit better. Maybe we could have the vision type rows clickable, and expand to show all the different fields it's passing/failing so it's easy to understand what's wrong.

samC3 commented 4 years ago

Ah that makes more sense! I hadn't noticed that the WCAG spec didn't specify that. Definitely makes sense to drop the 15px requirement.

What would the fields be that it could pass or fail on under each field?

Potentially it could auto expand on each field if it fails to make it easy to quickly see what is going wrong? Although that could be too much information if it fails on too many fields.

It would be interesting to try and convey the math going on, maybe pull out the calculation from the tooltip on the grading and put it under the overall score. To stop it from crowding the screen could make that an expandable field as well to show more details if you're interested?

megaroeny commented 2 years ago

Actually I don't see font size taken into account at all? I tried using 1px font size and it still passes 🫣😅

Try this: https://www.whocanuse.com/?bg=663399&fg=ffffff&fs=1&fw=

cstrobbe commented 1 year ago

As far as I know, WCAG doesn't specify a minimum font size for several reasons:

megaroeny commented 1 year ago

@cstrobbe ah yes good point! I learned about this recently, after trying to dig deeper into minimum font sizes (it is recommended to keep at least 12 from what I've read). Thanks for clarifying that!