Re: [csswg-drafts] [css-properties-values-api] A compact syntax for registering global constants/custom properties (#9206)

> For "global" things, there are two possible behaviors you could be invoking

I was in fact invoking behavior 1, and mentioned `env()` as an option. Glad to hear that could work reasonably well. 

I'm open to closing this as a duplicate of:

- https://github.com/w3c/csswg-drafts/issues/2627 (for the 'global' part)
- https://github.com/w3c/csswg-drafts/issues/7523 (for the 'shorthand' part)

But the reason I opened this issue in the first place is to capture where they overlap in terms of author use-case and needs. Because they do. Currently `@property` is not a reasonable solution for defining either local or global variables, and authors would like a solution that can handle both in one place. So our solutions have to work together in an elegant way here. Because, from an authoring perspective, they are part of the same project of defining the initial/global state of variables.

For example, [the limitation I mentioned above](https://github.com/w3c/csswg-drafts/issues/9206#issuecomment-1683052586) is a likely issue for both proposals. Initial values restricted in that way will not cover the use-case for global values, and will also not act as a replacement for defining custom properties on the root element. 

(I linked `@custom-media` above, and mentioned global variables could be used to achieve the same thing. I believe Anders was referring to that.)

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


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

Received on Thursday, 17 August 2023 23:49:01 UTC