Skip to content

[css-text-decor-4] Consider renaming text-decoration-trim #8402

Closed

Description

@SebastianZ

Besides the general discussion in #4557 to introduce a way to modify the length of the decoration, there was also some discussion around how to call the property. As I previously summarized, name suggestions for it so far were:

  • text-decoration-trim
  • text-decoration-inset
  • text-decoration-limit
  • text-decoration-clip

As there are also use cases for extending the decorations beyond their normal size. In my opinion, "trim" doesn't express that well enough. Therefore I slightly tend towards "limit".

We have a poll running in comments below:
#8402 (comment)
#8402 (comment)

Sebastian

Activity

  1. jfkthame commented on Aug 8, 2025

    @jfkthame
    Contributor

    We're in the process of implementing this, so if there's going to be some naming bikeshedding, we'd appreciate it happening sooner rather than later.

    (Personally, I'm happy with text-decoration-trim; the idea that "negative trimming" extends the line doesn't bother me. Neither -limit nor -clip seem nearly as clear; -inset would be OK but no better than -trim.)

  2. SebastianZ commented on Oct 14, 2025

    @SebastianZ
    ContributorAuthor

    I'd argue that *-inset is definitely better than *-trim and would also be more conform with other properties like view-timeline-inset or inset-*.

    All the other properties that have "trim" in their name like white-space-trim, text-box-trim, margin-trim, etc. are keyword-based. And trim rather indicates cutting off something rather than potentially expanding it. Therefore I am strongly against using *-trim and *-clip and prefer either *-inset or *-limit.

    Sebastian

  3. jfkthame commented on Oct 14, 2025

    @jfkthame
    Contributor

    Thinking about this again, I'm feeling less in favor of -inset here. Not sure how well I can articulate this, but fwiw....

    To my mind, inset properties are about adjusting their target element in relation to another element (a parent or containing box). Given an element that is being sized or placed within an area that has been defined by some external thing, it makes sense to have the ability to "inset" (or expand, by use of negative inset) that area.

    But with decoration lines, it's not readily apparent to an author that there is any such "container" to apply insets to. The decoration line seems more like an attribute of a range of text, and its length is determined by the length of that text, not in relation to some containing element, so the idea of "insetting" from such a container is a little odd.

    Arguably the inline element (or pseudo, e.g. ::selection) that defines the decorating line could be considered that container, and the spec talks of the "decorating box", so insets can reasonably be applied to that box, but I don't think this is a model that will generally be at the front of an author's mind. To an author, a decorating line is an independent thing that simply appears below (or above) a range of text. The property under discussion here directly adjusts the length of that line, by "trimming" a certain amount from each end, not by "insetting" it from a containing area.

    (As for negative values, a negative "trim" extends and a negative "inset" expands; these seem equally reasonable concepts to me.)

  4. SebastianZ commented on Oct 14, 2025

    @SebastianZ
    ContributorAuthor

    Just to throw in some more alternatives:

    • text-decoration-adjust
    • text-decoration-{size|length}-adjust
    • text-decoration-resize

    Not necessarily saying that those are any better than the previous options.

    To my mind, inset properties are about adjusting their target element in relation to another element (a parent or containing box). Given an element that is being sized or placed within an area that has been defined by some external thing, it makes sense to have the ability to "inset" (or expand, by use of negative inset) that area.

    But with decoration lines, it's not readily apparent to an author that there is any such "container" to apply insets to. The decoration line seems more like an attribute of a range of text, and its length is determined by the length of that text, not in relation to some containing element, so the idea of "insetting" from such a container is a little odd.

    "Insetting" to me means relative to something, not necessarily a containing element. Though I can see your point. The existing *-inset-* properties we have are also related to some containing element.

    Having said that, I still believe "limit", "inset" and possibly also "(length-)adjust" express the meaning better than words in the meaning of cutting off or taking away something.

    Though I am not a native speaker. And so far there were only a few opinions expressed. Maybe someone could set up a quick naming poll somewhere to reach a broader audience, maybe @mirisuzanne or @jensimmons? (I'm not on the big messaging/social media platforms, so can't do that myself, unfortunately.)

    Sebastian

  5. mirisuzanne commented on Oct 14, 2025

    @mirisuzanne
    Contributor

    I don't have strong feelings here, text-decoration-trim seems ok to me. *-edge might also be an option?

    I'm happy to share a poll – but Mastodon only allows 4 options, and Bluesky doesn't have built-in polling at all. We could try an emoji poll here instead, and link from social media posts?

  6. fantasai commented on Oct 14, 2025

    @fantasai
    Collaborator

    There's something similar here with the column-rule properties that @kbabbitt has been working to spec in https://www.w3.org/TR/css-gaps-1/#outset ... They're using *-rule-outset. Maybe text-decoration-outset would work here? Keeping them consistent seems like a good plan in any case.

  7. kbabbitt commented on Oct 14, 2025

    @kbabbitt
    Collaborator

    Gap Decorations does use outsets right now, though in #12848 I'm contemplating flipping them to insets.

    For the property we're discussing here, which do we expect to be the more common use case - extending or shrinking? Depending on the answer to that, I'd prefer either outset or inset respectively, such that positive values would reflect the more common case. I would prefer either of those over trim for the reasons @SebastianZ gave. I don't like adjust because that's not clear on which is the positive-value direction, or even what's being adjusted - I could see it being confused for adjustment up or down from the text baseline, for example.

  8. SebastianZ commented on Oct 14, 2025

    @SebastianZ
    ContributorAuthor

    For the property we're discussing here, which do we expect to be the more common use case - extending or shrinking?

    From my experience, shrinking is much more common than extending. See the examples I linked to in #8403.

    I don't like adjust because that's not clear on which is the positive-value direction, or even what's being adjusted - I could see it being confused for adjustment up or down from the text baseline, for example.

    Therefore, I also provided a text-decoration-{size|length}-adjust option. But I admit, it's a bit lengthy.

    Sebastian

  9. SebastianZ commented on Oct 15, 2025

    @SebastianZ
    Author
  10. 20 remaining items

  11. rianmurnen commented on Oct 16, 2025

    @rianmurnen

    @oddbird Yeah, the cap shape idea does open up the idea of custom start/end terminals like ball, square, arrowheads, and wanting size/scale them independent of -thickness.

    I wasn't thinking about combing a shape with a value (round 10px), but I see what you mean about the cascade and shorthand in that approach.

  12. Crissov commented on Oct 17, 2025

    @Crissov
    Contributor

    Just for the record, CSS already inherits the term cap from SVG for the stroke-linecap property in the Fill & Stroke Module. (The hyphen one would expect therein is missing in fact just because.)

    For what it’s worth, CSS Fonts always abbreviates plural ”capitals“ as caps in its property names and keyword values, but the related unit in CSS Values is called cap, as is the respective keyword for line-fit-edge in CSS Inline.

  13. fantasai commented on Oct 21, 2025

    @fantasai
    Collaborator

    I'm a bit disappointed that the existing name column-rule-outset wasn't included in the poll. Though I suppose text-decoration-outset and text-underline-offset are maybe too close together? Still, would have been nice to see how people react to it.

    I'm also still a bit concerned that inset, as @jfkthame mentioned, is associated with layout properties that move things around (rather than trimming them)...

  14. jfkthame commented on Oct 21, 2025

    @jfkthame
    Contributor

    In my opinion, -outset has the same drawback as -inset, that it sounds like it could be affecting layout and not merely rendering; but in addition, it would have us using negative values for the common case, at least in the case of text-decoration (I'm not sure which way the balance is likely to lie for column-rule). I also think "outset" is less familiar in general as an everyday word/concept than "inset".

    While I personally still like -trim, I think the overall preference for -inset seen in #8402 (comment) is pretty clear, so I'm suggesting we should resolve on that; I'm not sure there's much more useful discussion to be had at this point.

  15. mirisuzanne commented on Oct 22, 2025

    @mirisuzanne
    Contributor

    inset() is also a basic shape, which is used for rendering concerns, not for layout. I disagree that these terms are somehow layout-specific.

  16. css-meeting-bot commented on Oct 29, 2025

    @css-meeting-bot
    Member

    The CSS Working Group just discussed [css-text-decor-4] Consider renaming `text-decoration-trim` , and agreed to the following:

    • RESOLVED: name this (and gap-deco props) with -inset
    The full IRC log of that discussion <TabAtkins> SebastianZ: last call, we were already discussing this and decided to create a poll
    <TabAtkins> SebastianZ: it looks like the poll settled on text-decoration-inset
    <TabAtkins> SebastianZ: there were still some discussions around that name being perfect, tho
    <TabAtkins> SebastianZ: there was also a suggestion to add text-dec-cap property
    <lea> q+
    <TabAtkins> SebastianZ: might not cover the use-case of trimming/expanding decorations, but influencing how it looks in the end, how the edges are capped
    <astearns> ack lea
    <TabAtkins> lea: what's the value space? a length or an offset?
    <TabAtkins> fantasai: a length
    <TabAtkins> jfkthame: I'd like to suggest we resolve on -inset per the poll, and make the corresponding change to the gap decorations property to match
    <kbabbitt> q+
    <TabAtkins> SebastianZ: we were going to change the decorations too?
    <lea> q+
    <TabAtkins> fantasai: yes, I wanted them in the poll since we'd be changing them too
    <astearns> ack kbabbitt
    <TabAtkins> SebastianZ: I mentioned them in the post at least
    <TabAtkins> kbabbitt: wrt gap-deco, I used -outset for a few reasons about behavior
    <astearns> also not a fan of 'outset'
    <TabAtkins> kbabbitt: I don't super like outset, it's less common then -inset
    <TabAtkins> kbabbitt: but since the predominant use-case is to shorten rather than lengthen, I think -inset makes more sense
    <astearns> ack lea
    <schenney> q+
    <dbaron> IMO -inset versus -outset naming implies which direction positive numbers go and which direction negative numbers go!
    <fantasai> yes
    <TabAtkins> lea: one of my issues with these is they imply the adjustment goes a certain direction, reducing the length, but they can also increase. trim, limit, cap all reduce
    <fantasai> but we can flip them around depending on the name, that's ifne
    <TabAtkins> lea: in some ways length-adjust would be ideal but too long
    <kbabbitt> +1 dbaron
    <TabAtkins> jfkthame: length-adjust doesn't tell you which direction you're adjusting it
    <astearns> ack schenney
    <astearns> ack dbaron
    <TabAtkins> schenney: regarding cap, might be worth allowing a reference to a path so you can adjust more than just the cap. so i'm inclined to defer that until a later proposal
    <TabAtkins> dbaron: [restates what they said in IRC]
    <TabAtkins> dbaron: there's other names where it's not clear which way is which
    <lea> q?
    <TabAtkins> lea: someone proposed -spread which is interesting, but didn't get votes
    <TabAtkins> jfkthame: sounds like it would imply a blur or thickening...
    <TabAtkins> lea: how does this affect skip-ink?
    <noamr> text-decoration-adjust ?
    <TabAtkins> jfkthame: it doesn't, skipping happens in the adjusted line
    <JoshT> q+
    <dbaron> s/[restates what they said in IRC]/I'd expect text-decoration-inset to mean positive numbers make the line shorter and negative numbers make the line longer; I'd expect text-decoration-outside to mean the reverse/
    <TabAtkins> astearns: so all these options have drawbacks, but I think we could resolve on -inset. seems like the least worst option and has some proponents
    <astearns> ack JoshT
    <TabAtkins> JoshT: curve ball, did we discuss making it similar to box-shadow? where you specify inset keyword to make it inset?
    <TabAtkins> fantasai: I think negative vs positive covers this. box-shadow doesn't have that, insets are qualitatively different than outset shadows
    <TabAtkins> fantasai: personally I prefer outset, growing feels more natural to me. but I don't have an objection. disappointed outset wasn't in the poll
    <TabAtkins> lea: there's been a lot of polls, don't have a great overall feel for what's voted on
    <TabAtkins> astearns: chair hat off, i'd dislike outset. not a common word, and weird to have this one place we use outset
    <TabAtkins> TabAtkins: I think we should try to resolve as jfkthame said, taking the poll winner
    <TabAtkins> proposed resolution: name this (and gap-deco props) with -inset
    <kbabbitt> +1
    <TabAtkins> astearns: objections?
    <TabAtkins> RESOLVED: name this (and gap-deco props) with -inset
  17. SebastianZ commented on Nov 11, 2025

    @SebastianZ
    ContributorAuthor

    The CSS Text Decorations part just got merged. #13024 targets the CSS Gap Decorations part.

    Sebastian

  18. jav099 commented on Dec 17, 2025

    @jav099
    Collaborator

    The CSS Gap Decorations part just merged, should this now be marked as closed?

  19. SebastianZ commented on Dec 18, 2025

    @SebastianZ
    ContributorAuthor

    Yes, I think so. Thanks for the change, @jav099!

    Sebastian

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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Sponsor
    SponsoredKunjungi sekarang
    Promo