Re: [csswg-drafts] [css-om] Serialization of font-family names: quoted string vs keyword (#5846)

  > This highlights an additional case that should be mentioned in the Option 2 rules for when the value must be quoted: if the value contains leading, trailing, or multiple consecutive spaces.

Doesn't it already cover that? Spaces are not alphanumeric and need escapes so the value serializes as `<string>`.

Fwiw, Option 2 is *only* partially equivalent to what was introduced for [`<keyframes-name>`](https://drafts.csswg.org/css-animations-1/#typedef-keyframes-name) by #13151 (with no corresponding resolution):

  > When serialized, the value is serialized as an `<ident>` unless it’s a disallowed keyword, in which case it’s serialized as a `<string>`.

E.g. `animation-name: "A  B"` should serialize as `animation-name: A\ \ B`. 

I do not know if this inconsistency is relevant, since I still do not know why `<family-name>` (and `<keyframes-name>`) cannot serialize as parsed, i.e. as `<string>` when parsed as `<string>`, as `<ident>+` when parsed as `<ident>+`, at least for declared values, instead of normalizing `<ident>+` to `<string>` or the other way around.

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


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

Received on Thursday, 12 February 2026 05:22:12 UTC