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

On Wed, 04 Jun 2014 23:40:51 -0400, Liam R E Quin wrote:
> > I would like to propose new relative length units:
> 
> >     'lh'    line-height of the element
> 
> I support this strongly.

+1 from me as well, whether it counts or not.

> 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.

This is a great idea as well.

> 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.

Absolutely.
And given that text-overflow did not gather the necessary traction,
probably due to possibly inconsistent / incomprehensible or just
unexpected behavior, this would help whoever wants to fit a dynamic
length text in a fixed bounding box regardless of whether the fonts
are available or the media resolution changed or not greatly.

Victor

Received on Friday, 16 October 2015 09:57:40 UTC