Re: [csswg-drafts] [css-properties-values-api] Shorthand for custom property declaration (#7523)

> From the author perspective at least, we don't need a universal answer outside the contexts where length values are allowed. 2em is a valid length, and should be allowed as an initial value, even if it will have different meanings in different contexts. Context-dependence is the whole point of the responsive unit.

I'll say it [again](https://github.com/w3c/csswg-drafts/issues/9206#issuecomment-1683811677) since we're discussing the same thing in multiple issues: this idea is not compatible with the other goal (stated here or a related issue) of making "global" custom properties even more global for performance/memory reasons. In fact it makes it much worse. Currently, if the computed value of a custom property is the initial value, we can represent that (per-element) as _not storing it on the element_, and instead looking up the (per-document) initial value. With this new idea, we'd actually have to add the initial value(s) to the cascade for each element, duplicating the whole set of custom properties for each element (in the worst case).

But "unfortunately" it makes a lot of sense from an author perspective, and together with the `env(--mything)` approach it seems to solve everything ...

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


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

Received on Tuesday, 22 August 2023 08:01:02 UTC