Re: [csswg-drafts] [css-values] Add a way to set longhands to the corresponding expansion of a shorthand value (#8055)

> but still doesn't let you reserialize the shorthand when one of the longhands is modified.

Yes, but it's not strange that a shorthand may not be able to represent all possible values of the longhands, and it's not such a big deal, since `cssText` can serialize longhands if shorthands don't work, and iterating a `CSSStyleDeclaration` goes through the longhands. So the important thing is being able to serialize the longhands.

Being able to specify which longhand to extract would offer more flexibility but it still doesn't guarantee that all shorthands will be serializable, and it opens the can of worms of using values from one property on another, which is difficult to define since some browsers normalize values at parse time by adding/removing/reordering components, which may affect whether it's still valid in the other property. Even in the same property it seems tricky if `from-shorthand()` can be mixed with other things, that's why I think it should be the only component and for the same property.

> using `:` instead would be much better imo

Yes I thought about `:` after filing the issue, may be the most clear option. Comma seems potentially confusing in e.g. `transition-property: from-shorthand(transition, margin, padding)` if you are not familiar with the function.

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


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

Received on Friday, 11 November 2022 23:08:14 UTC