geoffrich,
@geoffrich@front-end.social avatar

A bit of a work conundrum...

  1. We render part of a page inside multiple websites we don't control (so we don't have control over the site's CSS, just our own)
  2. We want to use rem units so it adjusts to the user's preferred font size
  3. However, some of these sites do things like "font-size: 62.5%" on <html>, which makes our page section look smaller than expected (since root font size is now 10px instead of 16px)

Is there a way to get consistent sizes and keep using rem units?

geoffrich,
@geoffrich@front-end.social avatar

Like, the whole deal with rem is it's relative to the root, so I'm not sure there's a good way. But em is too relative, since I don't want it relative to each child's parent.

for why rem is preferred over px, see these articles from Josh and Josh:

https://joshcollinsworth.com/blog/never-use-px-for-font-size
https://www.joshwcomeau.com/css/surprising-truth-about-pixels-and-accessibility/

  • All
  • Subscribed
  • Moderated
  • Favorites
  • CSS
  • kavyap
  • thenastyranch
  • Durango
  • DreamBathrooms
  • ngwrru68w68
  • magazineikmin
  • cisconetworking
  • Youngstown
  • mdbf
  • slotface
  • osvaldo12
  • GTA5RPClips
  • rosin
  • InstantRegret
  • provamag3
  • everett
  • cubers
  • vwfavf
  • normalnudes
  • tacticalgear
  • tester
  • ethstaker
  • khanakhh
  • modclub
  • Leos
  • anitta
  • megavids
  • JUstTest
  • All magazines