W3C home > Mailing lists > Public > public-css-archive@w3.org > April 2017

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

From: Florian Rivoal via GitHub <sysbot+gh@w3.org>
Date: Mon, 10 Apr 2017 05:19:40 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-292852138-1491801579-sysbot+gh@w3.org>
> 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

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 10:12:53 UTC