WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 7 months ago

Last modified 7 months ago

#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:
PR Number:

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

Change History (2)

#1 @desrosj
7 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

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.

#2 @tripflex
7 months ago

@desrosj it's okay, i honestly forgot I even opened this one TBH and would have brought it up on Slack if it was something i was concerned about not getting response on :)

Note: See TracTickets for help on using tickets.