Skip to content

[css-inline-3] Rethinking line-sizing and leading-trim #5168

Description

@fantasai

I wanted to follow up on some thoughts:

  • dbaron's musings in A Coruña
  • 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 (or just watch the whole thing if you prefer ;)
  • Handling descendant inlines on the first/last line for leading-trim
  • 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.

Starting from some of 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 half-leading
    • normal inline box ignores 'line-height', contributes margin-box edge
    • <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 on all lines
    • 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions