Re: [css-values] Line-height relative length units 'lh' and 'rlh'

On Sun, 2014-06-01 at 16:29 +0900, MURAKAMI Shinyu wrote:
> I would like to propose new relative length units:
> 
>     'lh'    line-height of the element

I support this strongly.

>     'rlh'   line-height of the root element

No opinion here.

[...]

> To prevent circular dependency, the following limitations are needed:
> 
> - 'lh' cannot be used on 'line-height' and 'font-size' property value

Or it has the same meaning as a percentage, resolved against the
inherited value.
  body { line-height: 17px; }
  div.outer {  line-height: 3lh; width: 10lh; }
would give the div.outer 3 * 17 px line height, i.e. 51px,
and a width of 510px.

Although the CSS line box isn't actually what typographers have
traditionally used (since baseline and font-height or cap-height etc.
are more usual alignment points than an invisible box surrounding the
line) line-height would in practice work out to baseline spacing, which
is a sorely missed unit, especially for print formatting where you want
to make a lot of heights a multiple of the line height to minimize
distracting show-through and save money by using thinner paper. This is
related to a baseline grid, but not the same.

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml

Received on Thursday, 5 June 2014 03:40:56 UTC