You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today, there's no way to provide type-hints to consumers about a CSS custom property (e.g. '<color>', '<length>', etc.) This requires component authors to have very explicit property names (--my-foo-color) or document the property adequately in the description. Unfortunately, neither is suitable for IDE intellisense support.
Chrome has shipped the CSS @property rule and enabled by default as of 85, and the CSS Properties and Values API as of 78.
Proposal
Add a "type" property to the Custom CSS Property schema. Manifest consumers can treat the omission of this value as '*', which I believe is the default behavior of Custom CSS Properties.
We can additionally strongly type the TypeScript declaration schema with all the legal string values
The text was updated successfully, but these errors were encountered:
This is a good idea. I think we should add a "syntax" field to more closely match the properties and values APIs. I wish we had used "initialValue" rather than "default" for that reason.
Summary
Today, there's no way to provide type-hints to consumers about a CSS custom property (e.g.
'<color>'
,'<length>'
, etc.) This requires component authors to have very explicit property names (--my-foo-color
) or document the property adequately in the description. Unfortunately, neither is suitable for IDE intellisense support.Chrome has shipped the CSS
@property
rule and enabled by default as of 85, and the CSS Properties and Values API as of 78.Proposal
Add a
"type"
property to the Custom CSS Property schema. Manifest consumers can treat the omission of this value as'*'
, which I believe is the default behavior of Custom CSS Properties.We can additionally strongly type the TypeScript declaration schema with all the legal string values
The text was updated successfully, but these errors were encountered: