Open
Description
@property at-rule registers a custom property for runtime type checking, setting default value and configuring inherit behavior. Stylable can improve DX of custom properties by keeping track of the registration of a property and providing static language services around them:
- completions for valid syntax types
- multipliers for lists of values
- combinators for complex syntax combinations
- might be interesting to offer built in shorthand types (
'<--background>'
)
- hover information to show the type, initial-value and inherit behavior
- completion for valid places (can suggest relevant properties inside a
var()
value or the entirevar(--color)
where appropriate) - diagnostics
- mismatch property in a position that can be identified to have a mismatched type
- make sure initial-value is valid for the registered type
- Not sure if needed, but Stylable can offer fallback registration through CSS.registerProperty
Edit:
In addition transforming @property
rule should:
- namespace the property (support global)
- export the property even when not used in any declaration