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

Hm, this definitely solves the round-trip (setting a longhand to itself) and cssText issues, but still doesn't let you reserialize the shorthand when one of the longhands is modified.

If we specified *which* longhand was being extracted from the shorthand, rather than it being contextual from the property it's used in, we'd get around that, but it would open us up to allowing less-sensical things to be specified, like `font: from-shorthand(font font-family, ...) from-shorthand(font family, ...);`. I suppose keeping it contextual and thus only valid in longhands lets us keep the resolved value abstract and not have to worry about how it combines with other things.

---

Nit: I wouldn't use `;` for this. It's not necessary for disambiguation, and I want to keep `;` as only being used where absolutely necessary. I think `,` is fine, but if we really think it could be confusing, using `:` instead would be much better imo: `margin-left: from-shorthand(margin: var(--x));`. 

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8055#issuecomment-1312238975 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 22:28:59 UTC