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

Re: [css-line-height] Conditional line-height

From: Simon Sapin <simon.sapin@exyr.org>
Date: Sun, 05 May 2013 07:25:04 +0200
Message-ID: <5185ED30.50508@exyr.org>
To: Florian Vanthuyne <accounts@flovan.me>
CC: www-style@w3.org
Le 02/05/2013 19:12, Florian Vanthuyne a écrit :
> 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!

Hi Florian,

I think adding this would be doable, but I don’t understand why it’s 
needed. Could you give some code example of this unwanted vertical 
whitespace?

Cheers,
-- 
Simon Sapin
Received on Sunday, 5 May 2013 05:25:29 UTC

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