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

This issue is doing two separate things: mass registrations *and* making things "global". We should keep those topics separate; mass registration is already in #7523. (And I've just dropped a syntax suggestion over there that I quite like, modulo the rule name.)

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

1. The property should be available at the "global" level, and usable in other at-rules, MQs, etc with its initial value.
2. The property should be *static*, and not changeable at different parts of the tree. (This might help with the perf issues from having several hundred or even thousands of custom properties for a design system.)

Calling back to my env() comment, I think we can cleanly achieve 1 without even having to do anything by just letting `env()` take a dashed-ident. (Well, technically it already does allow that, but no dashed-ident keywords are defined for it or ever will be.) If the "environment variable name" is dashed, it just looks up the initial value of the corresponding custom property, done.

For 2, this could just be a new descriptor in the registration block. Dunno what a good name is, tho.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9206#issuecomment-1683089672 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:05:36 UTC