W3C home > Mailing lists > Public > www-style@w3.org > June 2014

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

From: MURAKAMI Shinyu <murakami@antenna.co.jp>
Date: Sun, 01 Jun 2014 16:29:49 +0900
To: www-style@w3.org
Message-Id: <20140601162948.8E5B.C598BCD7@antenna.co.jp>
I would like to propose new relative length units:

    'lh'    line-height of the element
    'rlh'   line-height of the root element

(refer the used value of the line-height property)

The line-height relative length units are necessary for specifying
the block-size of a block container using number of lines.

Examples:

  @page {
    height: 20rlh; /* n of lines per page */
  }

  p {
    margin-top:    1lh;  /* keep paragraph spacing to 1 line-height */
    margin-bottom: 1lh;
  }

To prevent circular dependency, the following limitations are needed:

- 'lh' cannot be used on 'line-height' and 'font-size' property value
- 'rlh' cannot be used on root element's 'line-height' and 'font-size' property value

Thoughts?


Shinyu Murakami
Antenna House
Received on Sunday, 1 June 2014 07:30:18 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:22 UTC