W3C home > Mailing lists > Public > public-css-archive@w3.org > June 2020

[csswg-drafts] [css-inline-3] Rethinking line-sizing and leading-trim (#5168)

From: fantasai via GitHub <sysbot+gh@w3.org>
Date: Thu, 04 Jun 2020 17:33:11 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-631019841-1591291990-sysbot+gh@w3.org>
fantasai has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-inline-3] Rethinking line-sizing and leading-trim ==
I wanted to follow up on some thoughts:

- [dbaron's musings in A Coruña](https://lists.w3.org/Archives/Public/www-style/2020Feb/0020.html)
-  Issues around `line-sizing: normal`’s model working fine if `line-height` has significant slack, but not if it doesn't: the half-leading on the root element isn't enough to handle slight shifts in ascent/descent due to varying font-families, for example, if there's hardly any half-leading. See [this video from ~11:37 - 12:30](https://www.youtube.com/watch?v=OtlGo48iTOk) (or just watch the whole thing if you prefer ;) 
- [Handling descendant inlines on the first/last line for `leading-trim`](https://github.com/w3c/csswg-drafts/issues/3956)
- Possible benefits of splitting the choice of metric into an inheritable, independently-cascading property, leaving `leading-trim` to focus on whether or not to trim.

Working from dbaron's comments, I suspect reworking the relationship of these two features might solve a lot of these issues.

For example, what if instead of `line-sizing: legacy | normal` (inheritable) and `leading-trim-over/under: normal | <metric>` (non-inheritable, applies to block containers, inline boxes) we had:

- `text-edge-over/under: leading | normal | <metric>` (inheritable, applies to inline boxes except root inline)
    - `leading` inline box does the usual thing of contributing its `line-height`, including half-leading
    - `normal` inline box ignores 'line-height', contributes margin-box size
    - `<metric>` is like `normal`, but also trims the content-height from ascent/descent down to specified metric
- `leading-trim: normal | start | end | both` (non-inheritable, applies to block containers)
    - `normal` applies half-leading over/under the root inline box
    - `start` trims outer half-leading of root inline box on first line, down to `text-edge` metric
    - `end` trims outer half-leading of root inline box on last line, down to `text-edge` metric


Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5168 using your GitHub account
Received on Thursday, 4 June 2020 17:33:12 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:09 UTC