W3C home > Mailing lists > Public > public-css-archive@w3.org > January 2017

[csswg-drafts] [css-rhythm-1] Avoiding accidental double spacing

From: Florian Rivoal via GitHub <sysbot+gh@w3.org>
Date: Mon, 16 Jan 2017 09:14:36 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-200964929-1484558075-sysbot+gh@w3.org>
frivoal has just created a new issue for 
https://github.com/w3c/csswg-drafts:

== [css-rhythm-1] Avoiding accidental double spacing ==
The spec for https://drafts.csswg.org/css-rhythm/#line-height-step 
says that

> It is usually recommended to set the line-height lower than the step
 unit. The used line height can increase due to several factors such 
as the use of vertical-align or font fallback. 


The initial value of line-height is `normal` which is [defined like 
this](https://drafts.csswg.org/css21/visudet.html#propdef-line-height):

> normal
>    Tells user agents to set the used value to a "reasonable" value 
based on the font of the element. The value has the same meaning as 
<number>. We recommend a used value for 'normal' between 1.0 to 1.2. 
The computed value is 'normal'. 

Actual implementations are know to vary, and in practice the actual 
numerical value of `line-height: normal` is unpredictable. Ideally 
authors will not rely on it and manually set the `line-height` when 
they want to use `line-height-step`, but we should try to be robust 
when they don't.

If `normal` in a particular browser on a particular os with a 
particular font is equivalent to `1.15`, and on a different 
browser/os/font combination, it is equal to `1.25`, and an author 
leaves `line-height` at the default value, and sets `line-height-step`
 to `1.2em`, things will look fine in one browser and not in the 
other, and the author may not know if they do not test in that 
particular browser/os/font combination.

I think it is quite important to reduce or eliminate this kind of 
situation, so we should do something.

How about this:

When line `line-height-step` is not `0`, then `line-height: normal` is
 treated as `line-height: 1` when computing the used value. This would
 usually be appropriate (and in the odd case where it is not, it is 
always possible to set a manual value), and would eliminate variation 
between browsers, making naïve use of `line-height-step` more robust.

Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/938 using your GitHub 
account
Received on Monday, 16 January 2017 09:14:43 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:07 UTC