Page MenuHomePhabricator

Add {{em}} magic word
Open, Needs TriagePublic

Description

You can use em values to size tables, infoboxes and some other stuff, but not for images. This is crucial as skins can differ their base font size (13, 14, 16 px) and images in em-sized infoboxes might then overflow.

This way one could use [[File:{{{image}}}|{{#expr: {{em}}*24 }}px]] where {{em}} would substitute as number of px in 1 em

See also T247680 for alternative solution

Event Timeline

I'll quote https://engageinteractive.co.uk/blog/em-vs-rem-vs-px etc which covers the disadvantage of EMs:

For example, take a div with a font-size of 2em, then add a paragraph with a font-size of 2em. The font-size of that paragraph is now 2ems relative to the div. I quickly lose track of the maths and what size is what, and it quickly becomes unmanageable.

Sure, rem is what I mean :D

And how do you know, server-side, the number of px in 1 em for the current user?

PS: Did you read https://engageinteractive.co.uk/blog/em-vs-rem-vs-px ?

em could also be used as a wikitext-ish replacement for <em>...</em> though...

Perhaps a better name could be used