Re: [csswg-drafts] [css-rhythm-1] Avoiding accidental double spacing

> What is the computed value of max(1lh) when line-height: normal? I tried to learn what the lh spec says, but I can't read from it.

> Could you write down in more plain English?

`line-height:normal` behaves the same as if a number was specified, except the author doesn't know what that number is, since it depends on the font (and on how the browser chooses to deal with it).
But once the browsers knows the font and the font size, it can know how many pixels tall a line is going to be when line-height is normal. That's `1lh`. Of course the actual line might end up being taller if you change font size on inlines, or have inline images, or superscripts... But assuming a line with nothing special in it, you know how tall it would be.

So, if you have specify `20px safe`, either:
* that 20px is taller than what this natural line height would be, in which case, everything behaves exactly the same as you specified
* or 20px is smaller, in which case it's rounded up to the whatever the size of the line would be, and then use & inherit that rounded up value.

I think that should cover 99% of the use cases (which is why I made "safe" the default), and if you actually want the `unsafe` behavior, you can ask for it.



-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/938#issuecomment-292852138 using your GitHub account

Received on Monday, 10 April 2017 05:19:47 UTC