#38239 closed enhancement (duplicate)
Add font-size to root HTML element for rem support?
Reported by: | tripflex | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.7 |
Component: | Administration | Keywords: | |
Focuses: | Cc: |
Description
Currently the common.css
file does not define font-size in the html
element, which if a plugin is using rem
for font-size, will be based on 16px
default, instead of the 13px
which is set in the body
.
To add support for WordPress' default font-size of 13px
, the font-size
in the root html
element, would need to be set to something like font-size: 81.3%
which would match the body
font-size of 13px, calculated by 13/16 = 0.8125
Something to consider regarding this ... if we were to implement setting font-size in the html
element, this could cause issues for any devs that are using rem
for admin pages, they may have already adjusted their code to handle the 16px
default instead of WordPress' 13px
set for body.
https://core.trac.wordpress.org/browser/trunk/src/wp-admin/css/common.css#L204
https://www.w3.org/TR/2013/CR-css3-values-20130730/#font-relative-lengths
https://gist.github.com/glueckpress/5653233
Hi @tripflex,
Welcome to Trac! And thank you for opening this ticket. My apologies that it took so long to receive a response.
I am going to close this out in favor of #44643, and more specifically #46493. If you have any concerns with the approach being discussed and implemented there, please do weigh in.