Re: [css-values] possible circular dependency of lh unit

Le 2018-10-24 20:12, Amelia Bellamy-Royds a écrit :
> Hi Gérard,
> 
> There's a paragraph at the end of the section on font-relative units 
> that
> explains how circular references are avoided.
> https://drafts.csswg.org/css-values-4/#font-relative-lengths

Hello Amelia,

Thank you for your response. I missed that.

[snipped]

>> When used in the value of the font-size
>> <https://drafts.csswg.org/css-fonts-3/#propdef-font-size> property on 
>> the
>> element they refer to, they 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.

[snipped]

I am also confused about the meaning of that parg with regards to one 
particular code scenario.

Let's postulate that the computed metrics corresponding to the initial 
value of the line-height is 19.2px and that the initial font size value 
for the root element is 16px (these values are usually in effect in the 
CSS tests). Then what is the used font size for the root element in this 
rule:

html {font-size: 2lh;} /* I think it should be 38.4px */

Why that particular parg says "initial values of the font" and not 
"initial values of the font size"? And why not initial value of font 
size *or* line-height?

Gérard

Received on Thursday, 25 October 2018 20:17:25 UTC