Skip to content

Replace font-size absolute units with relative units#943

Merged
mlinksva merged 1 commit intogithub:gh-pagesfrom
aisgbnok:904-realtive-font-units
Feb 23, 2022
Merged

Replace font-size absolute units with relative units#943
mlinksva merged 1 commit intogithub:gh-pagesfrom
aisgbnok:904-realtive-font-units

Conversation

@aisgbnok
Copy link
Copy Markdown
Contributor

@aisgbnok aisgbnok commented Feb 23, 2022

Summary

I noticed #904 and thought I would attempt to resolve it. I believe I translated all font-size CSS properties from px to rem, in the application.css file.

If your browser is at the default font settings you should see no change in font size, and the site will look identical. If you modify your browser's font size you will now see the site's font size scale accordingly.

REM

Web browsers calculate REM from the root element size. By default, modern web browsers use 16px = 1rem. Therefore I performed px/16 = rem.

Rem is a relative unit meaning it is adjustable by the browser or by modifying the root element in CSS. As an example, if a user changes their browser's default font size then rem will increase/decrease accordingly. Therefore this change improves user accessibility.

Mozzila Documentation on CSS values and units.
WC3/WAI - Draft Tutorial

@mlinksva
Copy link
Copy Markdown
Contributor

Thanks @aisgbnok! At a glance the rendered version of this looks good to me. Further improvements or fixes welcome if needed.

@mlinksva
Copy link
Copy Markdown
Contributor

(The CI failure is due to an unrelated broken link, will address separately.)

@mlinksva mlinksva merged commit 958b684 into github:gh-pages Feb 23, 2022
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.

Use relative units for fonts (rem, em)

2 participants