- From: Romain Menke via GitHub <noreply@w3.org>
- Date: Fri, 04 Sep 2026 06:43:11 +0000
- To: public-css-archive@w3.org
see: https://github.com/w3c/csswg-drafts/issues/14442
-----
Can we make `private` a flag on custom property registration?
i.e. `@property --length <length> private: 1em;`
```css
/* lexically scoped to a stylesheet */
@property --length <length> private: 1em;
/* lexically scoped to a style rule */
.foo {
@property --length <length> private: 1em;
}
/* lexically scoped to a mixin */
@mixin --foo(--color <color>: red) {
@property --length <length> private: 1em;
box-shadow: var(--color) var(--length);
}
/*
functions don't have the exact same issues around potential naming conflicts,
but maybe private is also useful there?
*/
@function --foo(--color <color>: red) {
@property --length <length>: 1em;
@property --something <length> private: 1em;
result: var(--color) var(--length);
}
```
----
I think that the friction/resistance I experience around the current `@private` rule can be boiled down to:
- it combines two distinct actions: value assignment and marking as private
- marking as private has to be done in a separate rule and this rule is not the lexical scope
Being able to register a private prop directly in the rule that is the lexical scope would be a much more intuitive syntax.
--
GitHub Notification of comment by romainmenke
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/14432#issuecomment-5536771755 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 4 September 2026 06:43:12 UTC