[wp-trac] [WordPress Trac] #38239: Add font-size to root HTML element for rem support?

WordPress Trac noreply at wordpress.org
Wed Oct 5 22:12:28 UTC 2016


#38239: Add font-size to root HTML element for rem support?
----------------------------+-----------------------------
 Reporter:  tripflex        |      Owner:
     Type:  enhancement     |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Administration  |    Version:  trunk
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 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

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38239>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list