[css-houdini-drafts] [css-properties-values-api-1] Allow @property syntax checking to work with fallback value (#1096)

miragecraft has just created a new issue for https://github.com/w3c/css-houdini-drafts:

== [css-properties-values-api-1] Allow @property syntax checking to work with fallback value ==
I'm experimenting with the new `@property` at-rule and feel that it should include the ability to use `syntax` in conjunction with custom property fallback value.

For example, let's say I want to create a special `--width` custom property that accepts fractions (such as `1/2`, `2/5`) in addition to all the values allowed by the built-in `width` property including the unitless `0`, `<percentage-length>`, as well as all the keywords such as `auto`, `min-content`, `max-content`, `fit-content`.

Currently it's not possible to do so, but if we allow syntax checking with fallback, we can do:

```css
div {
  --width-percent: calc(var(--width) * 100%);
  width: var(--width-percent, var(--width));
}

@property --width-percent {
  syntax: "<percentage>";
  inherits:false;
}
```

So this is why I would like the spec to allow combining fallback with syntax checking.

Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/1096 using your GitHub account


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

Received on Sunday, 14 May 2023 18:34:14 UTC