Re: [csswg-drafts] [css-text] Reconsidering the CSS letter-spacing model (#10193)

Effectively, using terminology found in other properties ([ruby-align](https://drafts.csswg.org/css-ruby-1/#propdef-ruby-align) or [justify-content](https://drafts.csswg.org/css-flexbox/#propdef-justify-content)) and along the lines of what @xiaochengh is saying, we can think of this as:
* the spec currently describing `letter-spacing: 1px space-between;`
* Firefox implementing `letter-spacing: 1px space-after;`
* Webkit/Blink implementing `letter-spacing: 1px space-right;`
* @jfkthame proposing `letter-spacing: 1px space-around;`

The currently specified behavior remains preferable in my opinion, but if we're not going to get it, I find this to be an interesting proposal. That said, should get just one behavior, or should we give authors choice as @xiaochengh suggests? If there's choice, what's the default?

It's pretty easy to imagine specifying something like this:
```
letter-spacing: [normal | <length-percentage>] &&
                [ space-left | space-right | space-before | space-after | space-between | space-around]?
```
and either default to a particular value when omitted, or leave it up to the UA.

But this seems overkill.

An alternative could be to specify and implement the behavior proposed by @jfkthame, but also add a toggle to trim away the first and last half-spaces in the line. Making that opt-in is more compatible, opt-out gives better behavior by default. So something like:
```
letter-spacing: [normal | <length-percentage>] && trim?
```
or 
```
letter-spacing: [normal | <length-percentage>] && no-trim?
```
Possibly with long-hands (letter-spacing-amount &amp; letter-spacing-trim ?), if you want to to cascade independently.

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


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

Received on Wednesday, 17 April 2024 04:34:31 UTC