W3C home > Mailing lists > Public > www-style@w3.org > May 2013

[css-line-height] Conditional line-height

From: Florian Vanthuyne <accounts@flovan.me>
Date: Thu, 2 May 2013 19:12:24 +0200
Message-Id: <AC6F8A60-9922-4167-A8FA-90D6B5ED9654@flovan.me>
To: www-style@w3.org
I default my line-height to 1.5 at the body level so text element that span multiple lines are readable without extra styling. Sometimes though, this has to be reset to 1 when the element spans only one line, otherwise unwanted vertical whitespace is rendered. But with the rise of responsive/flexible designs some elements might span either one or multiple lines and there is no way to set a value for both cases without providing multiple media queries. So I would like to suggest something like:
line-height: 1, 1.5;

I think it is possible to check if an elements height is taller than its own line-height, which is when the second value would be used. Let me know what you think!

-
Florian
Received on Friday, 3 May 2013 12:28:52 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:29 UTC