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

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

From: Florian Rivoal via GitHub <sysbot+gh@w3.org>
Date: Wed, 04 Oct 2017 09:13:04 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-334096272-1507108370-sysbot+gh@w3.org>
> Is this issue suggesting to add e.g., auto to compute the step unit from the used line height? If that's the case, I'm ok with it.

I don't think that is what was being suggested, but I suppose it would make things better.

As I said in https://github.com/w3c/csswg-drafts/issues/938#issuecomment-292444751:
* When setting the line-heigh-step, you (almost?) never want to set it to something smaller than the line height of the element that establishes the rhythm.
* When inheriting line-height-step, you do want it to be able to be smaller than the line height of the element it is inheriting into. That is what enables things like titles to be enlarged to a multiple of the step size.

This means that if we go with an auto value, we probably needs to reuse a logic similar to the one I suggested in https://github.com/w3c/csswg-drafts/issues/938#issuecomment-292444751, where auto computes to the height of the line in `px`. That way, when you set something to auto, it gets the right height, but it keeps that same height when inheriting on descendants, preserving the rhythm.

So that would give us something like this:
` line-height-step: none | auto | <length>`:
* `none` computes to (or behaves as, I don't care) `0`
* `<length>` does the same as what the spec says now
* `auto` computes the height in `px` the line would have if it only contained the strut.

And this should come with a large warning telling authors to use `auto` rather than `<length>` to avoid interop problems.

Or maybe a slightly more expressive vairiant (based on what I suggested back then):
` line-height-step: none | auto | [ <length> [ safe | unsafe ]? ]`

* `none` computes to (or behaves as, I don't care) `0 unsafe`
* `auto` computes the height the line would have if it only contained the strut, in `px`, `unsafe`
* if both `safe` and `unsafe` are omitted, it is the same as `safe`
* `<length> unsafe` does the same as what the spec says now
* `<length> safe` computes to `max( auto, <length>)`

I like that a better because:
1) It is a little more expressive
2) it forces authors to type "unsafe" to get the behavior that has interop risks, and hopefully this will have enough of a deterrent effect that things will be alright.

> So I don't see much differences, but I understand our assumption on how authors use Line Grid is different, and if auto can save some English cases, I'm fine to add it.

I do not think this has anything to do with English vs Japanese. The example @astearns gave in https://github.com/w3c/csswg-drafts/issues/938#issuecomment-332631897 and the ones I gave in https://github.com/w3c/csswg-drafts/issues/938#issuecomment-332999350 are equaly likely to happen in any language.

-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/938#issuecomment-334096272 using your GitHub account
Received on Wednesday, 4 October 2017 09:12:52 UTC

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