You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"When used in the value of any font-* property on the element they refer to, the font-relative lengths resolve against the computed metrics of the parent element—or against the computed metrics corresponding to the initial values of the font and line-height properties, if the element has no parent."
Currently, as far as I can tell, it’s only the font-size and font shorthand that accept <length>s, so would it make sense to narrow down on font-size and font instead of font-* in this paragraph? With CSS gaining the ability to produce <number>s from <length>s, it may be beneficial to allow 1em to refer to the current font size in most cases, including some font-* properties.
The text was updated successfully, but these errors were encountered:
As seen in the live demo, there is an interop issue:
Firefox (stable/nightly macOS) and Safari (stable/TP macOS) use the current element’s font-size to compute 1em.
In Chrome (stable/canary macOS), --1em = 16px if the font-variation-settings is present (and reflects on padding as well). If the font-variation-settings declaration is removed, --1em becomes the element’s font-size. [Chromium#392317688]
I am unsure what the spec-mandated behavior is here, I believe the tracking issues for that are these?
A bit of an odd case resulting from my attempt at implementing @Lorp’s
font-optical-sizing: <number>
proposal with current CSS capabilities:A Chrome developer pointed in a bug report that, technically, the spec says:
Currently, as far as I can tell, it’s only the
font-size
andfont
shorthand that accept<length>
s, so would it make sense to narrow down onfont-size
andfont
instead offont-*
in this paragraph? With CSS gaining the ability to produce<number>
s from<length>
s, it may be beneficial to allow1em
to refer to the current font size in most cases, including somefont-*
properties.The text was updated successfully, but these errors were encountered: