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

Webapp > Help > Text size understanding : comments on pt => px conversion #136

Open
ArnaudDelafosse opened this issue Feb 18, 2018 · 6 comments

Comments

@ArnaudDelafosse
Copy link
Contributor

Observed behaviour

In the "Help" > "Minimum ratio" > " Level AA" and "Text size understanding" sections, it is implied that 14pt is equivalent to 14px and that 18pt is equivalent to 18px.

Expected behaviour

I believe this is incorrect if you follow the W3C's own "Contrast (Minimum) Understanding SC 1.4.3" in the "Note 1" section where it says "The ratio between sizes in points and CSS pixels is 1pt = 1.333px, therefore 14pt and 18pt are equivalent to approximately 18.5px and 24px."

What I understand is that for a given standard font-size where body { font-size: 100%; } p { font-size: 1rem; } sets your paragraphs a font-size of (equivalent to) 16px, contrast ratios for level AA should be at least:

  • 4,5 for body copy,
  • 3 for text in bold with a font-size of at least (equivalent to) 18.5px or 120% of body copy,
  • 3 for large text with a font-size of at least (equivalent to) 24px or 150% of body copy.

/!\ Reminder: do not use px to set your font sizes, these are pixel equivalences. Always use relative units like rem, em or %.

Steps to reproduce the behaviour

See this example on CodePen: https://codepen.io/ArnzWeb/full/WMdmGB/ (it's in French and I've voluntarily rounded 18.5 to 19px).

@mfaure
Copy link
Member

mfaure commented Feb 19, 2018

Thanks @ArnaudDelafosse for your clever feedback! This note wasn't present at the time of the doc writing. I just grep'd some git logs and found it was introduced on May 23, 2016.

Would you feel comfortable with fixing the doc ?

@ArnaudDelafosse
Copy link
Contributor Author

You're welcome, glad to bring a bit of help to this great tool.
Yes I'm fine with amending the doc, I'll try as soon as I can.

@dzc34
Copy link
Member

dzc34 commented Feb 21, 2018

@dzc34 dzc34 changed the title Comments on pt => px conversion Webapp > Help > Text size understanding : comments on pt => px conversion Feb 21, 2018
@ArnaudDelafosse
Copy link
Contributor Author

Once the suggestions I made for the Howto page are validated or not, I'll mirror that on the 2 remaining files.

dzc34 pushed a commit that referenced this issue Feb 25, 2018
see #136
Webapp > Help > Text size understanding : comments on pt => px conversion
dzc34 pushed a commit to dzc34/Contrast-Finder that referenced this issue Feb 25, 2018
see Asqatasun#136
Webapp > Help > Text size understanding : comments on pt => px conversion
@dzc34
Copy link
Member

dzc34 commented Feb 25, 2018

Thanks @ArnaudDelafosse for your contributing!
I splited your merge request #140 in two part for more easy review:

#142 is now merged in develop branch.

dzc34 pushed a commit to dzc34/Contrast-Finder that referenced this issue Apr 14, 2018
see Asqatasun#136
Webapp > Help > Text size understanding : comments on pt => px conversion
dzc34 pushed a commit that referenced this issue Apr 23, 2018
see #136
Webapp > Help > Text size understanding : comments on pt => px conversion
dzc34 added a commit to dzc34/Contrast-Finder that referenced this issue Apr 23, 2018
dzc34 added a commit that referenced this issue Apr 24, 2018
----------------------

  set version to 0.9.0
  Updated i18n files (add "nav.language" and "nav.language-switching")
  Spanish i18n file: added some "lang=en" attributs
  Spanish i18n file: fixed pt => px conversion
  Add Spanish i18n file
  Update i18files
  #136 - Webapp: fixed pt => px conversion ("Help" > "Text size understanding")
  webapp i18n - Languages switch: added spanish language
  Webapp - Hidding current contrast on default page
  DOC - Howto-use.md / Update for the pt => px conversion section
  Added missing files
  Fixed #148 - Contrast calculation is visible without scrolling
  Added getConstrastRatio2DigitRound() method to engine/utils/(...)/ContrastChecker.java
  updated i18n files for #148
  Updated i18n files
  set version to 0.8.7-SNAPSHOT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants