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

@Loirooriol According to its title, this issue is about a statement at-rule that allows a **briefer registration** of custom properties. This might be designed for all (current or future) variants of `@property`, or a subset thereof. 

**Mass registration** is the topic of #13212 (former Houdini 1058) where @LeaVerou, from the start, included both variants – i.e. lists of identifiers (= your “discrete set”) and identifier templates (by wildcards or affixes).

Making `@property` **descriptors optional** (and possibly making the at-rule non-exclusive) is discussed in #13211 now, after the Houdini repo apparently has been merged with the main CSSWG one. 

Both of these would likely be mirrored in a possible shorthand notation, discussed here. Personally, I find it difficult to keep these issues separated.

----

@mirisuzanne is correct of course that custom functions already establish a brief syntax for specifying a custom property‘s syntax (and default value), but not collectively for a list of properties. Also, the proposed `from` keyword does not do much more than using `var()` or `env()` would. 

~~~~ css
@property --text-color, --border-color <color>: var(--primary-color, black);
~~~~

@chriskirknielsen’s suggestion to simply move the syntax for basic values in front of the declaration block, is interesting. I think it would require a different name for the at-rule, perhaps `@value`, and “last one wins” should probably apply to each declaration separately, not to the whole block. 

~~~~ css
@value <color> {
--primary-color: black;
--text-color: var(--primary-color);
}
@value <color> {
--border-color: var(--text-color);
/* accidentally delete all matching registrations */
}
~~~~


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


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

Received on Friday, 12 December 2025 18:19:10 UTC