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

@korenevskiy You're right. I'm not saying it's necessarily a bad idea, and your new suggested approach is already much better in my opinion.

If we assume that most "simple" situations, the `@property` rule just needs those values, we could even set it up to use those three but no others, like this:
```postcss
@--color: '<color>' false / red;
```

Using the slash delimiter here is valuable similar to its usage in the background shorthand, to distinguish between the `initialValue` and `inherits` values. A syntax type of `'<boolean>'` is already in the works, so it could be confusing to eventually have multiple neighboring booleans inline:
```postcss
/* not great ❌ */
@--active: '<boolean>' true false;

/* better ✅ */
@--active: '<boolean>' true / false;
```

This also has the added benefit of allowing exclusion of the `inherits` value when `true` if desired, as it defaults to `true`. So the above line can be simplified further:
```postcss
@--active: '<boolean>' / false;

/* is equivalent to: */

@property --active {
  syntax: '<boolean>';
  inherits: true;
  initialValue: false;
}
```

Removing the slash changes the meaning of the boolean value—in this case—to be the `inherits` value rather than the `initialValue`:
```postcss
@--active: '<boolean>' false;

/* is equivalent to: */

@property --active {
  syntax: '<boolean>';
  inherits: false;
}
```


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


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

Received on Tuesday, 27 February 2024 17:17:51 UTC