Re: [csswg-drafts] [css-values] Proposal: `sp` and `rsp` space glyph units (#10534)

@jfkthame Thanks for the previous discussion reference. Percentage-based `word-spacing` sounds like a nice way to solve that particular use case.

The `word/letter-spacing` examples came up as I was exploring other potential use cases, however the initial scenario that prompted the proposal was usage of `0.Xch` as a rough space measure for `gap` in flex/grid contexts when placing an icon next to text, such as on a button or in a tag list. It occurred to me that if the font rendered is not what the author expects then an estimated `ch` value would probably be a bit off. Like you said about the `ch` and `ic` units, the value should be defined in terms of "the font used to render it." Considering network speeds and user preferences affect the rendered font, authoring a `ch` estimate according to one font but the user potentially seeing another carries some risk.

Personally I only use JS as a last resort when it comes to layout, as it can be fragile, so I just use an approximate `ch` at the moment.

-- 
GitHub Notification of comment by jbasoo
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10534#issuecomment-2213700913 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 8 July 2024 11:05:03 UTC