Path: blob/main/files/en-us/web/css/@property/initial-value/index.md
6516 views
------{{CSSRef}}{{SeeCompatTable}}
The initial-value CSS descriptor is required when using the {{cssxref("@property")}} at-rule unless the syntax accepts any valid token stream. It sets the initial-value for the property.
The value chosen as the initial-value must parse correctly according to the syntax definition. Therefore, if syntax is <color> then the initial-value must be a valid {{cssxref("color")}} value.
Syntax
Values
A string with a value which is a correct value for the chosen syntax.
Formal definition
{{cssinfo}}
Formal syntax
{{csssyntax}}
Examples
Add type checking to --my-color {{cssxref('--*', 'custom property')}}, as a color, the initial-value being a valid color:
Using CSS {{cssxref('@property')}} at-rule:
Using JavaScript {{domxref('CSS.registerProperty')}}:
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}