#1021: CSS Inline `text-box`, `text-box-trim`, and `text-box-edge` properties

Visit on Github.

Opened Dec 2, 2024

こんにちは TAG-さん!

I'm requesting a TAG review of CSS Inline text-box, text-box-trim, and text-box-edge properties.

To achieve optical balance of text content, the text-box-trim and text-box-edge properties, along with the text-box shorthand property, make finer control of vertical alignment of text possible.

Further details:

  • I have reviewed the TAG's Web Platform Design Principles
  • Relevant time constraints or deadlines:
  • The group where the work on this specification is currently being done: CSS WG
  • The group where standardization of this work is intended to be done (if different from the current group):
  • Major unresolved issues with or opposition to this specification:
  • This work is being funded by:

Discussions

Log in to see TAG-private discussions.

Discussed Feb 24, 2025 (See Github)

Xiaocheng: about vertical alignment ... e.g. aligning something to a capital letter's basline of a passage of text... difficult to do... can only align to the containing box ... another case is veritcal align a line of text with something else... and identify the middle line of the line of text.. This proposal introducuces text-box-trim - most basic usage is trimming the letting above and below the text... then use this to vertical align with some other content. In general I'm pretty positive with this proposal... Very multi-stakehodler. Solving an alignment problem ... might have interaction with borders, background, highlights... not sure if it's considered...

Martin: [I have to say: I've wanted this for some time for my own use: aligning baselines of different boxes is super fiddly.] I think it's the right thing to do is to ask the question about alternatives considered... "I know this changes the size of the box. Have you considered the implications..." Seems unlikely that they haven't considered this... Because we don't have an explainer here... I think it's good to ask them to explore some of the alternatives.

Dan: should we ask for an explainer?

Xiaocheng: there is an explainer... but we should ask them to put it in the CSS wg.

Martin: it's a good explainer...

Xiaocheng to draft some feedback in the issue asking for alternatives

Comment by @xiaochengh Feb 26, 2025 (See Github)

Hi @kojiishi, we discussed this at a TAG breakout today and are generally positive about it.

There's one concern. While solving vertical alignment, this feature changes the sizes of the boxes, which leads to interactions with background, highlights, borders, outlines and etc. Have the CSSWG assessed these interactions, or considered any alternatives that do not affect the sizes?

Besides, it will be better if the explainer is placed next to the spec.

Comment by @kojiishi Mar 5, 2025 (See Github)

Hi @xiaochengh, thank you for the comments.

There's one concern. While solving vertical alignment, this feature changes the sizes of the boxes, which leads to interactions with background, highlights, borders, outlines and etc. Have the CSSWG assessed these interactions, or considered any alternatives that do not affect the sizes?

I think so, it's intentional. If you have specific cases, can you file to https://github.com/w3c/csswg-drafts/issues ?

Besides, it will be better if the explainer is placed next to the spec.

I'm sorry but I couldn't understand what this means. Can you please expand?

Discussed Mar 24, 2025 (See Github)

Xiaocheng: this is about trimming the text box to allow vertical alignment ... last time I left a concern that we're resizing the boxes and that has led to concern .. I'm satisfied with the answer. It's been considered. Not try to outsmart the CSS wg on CSS.

Hadley: in my experience it's helpfull to remind them but yes.

Dan: i suggest closing here and we can re-play it at the plenary.

Hadley: totally agree.

Action: Xiaocheng to close as satisfied with comment.

Comment by @xiaochengh Mar 26, 2025 (See Github)

(Sorry for the delay)

Hi @kojiishi, thanks for the feedback! We discussed it today at a TAG breakout and happy to know that the side effects have been considered. We are satisfied with this new feature.