`initial-value` CSS at-rule descriptor
The initial-value descriptor of the @property at-rule specifies the initial value for the registered CSS custom property. It is a required descriptor unless the syntax descriptor value is the universal syntax ().
The **`initial-value`** descriptor of the @property [at-rule](/docs/Web/CSS/Guides/Syntax/At-rules) specifies the initial value for the registered [CSS custom property](/docs/Web/CSS/Reference/Properties/--*).
It is a required descriptor unless the syntax descriptor value is the universal syntax (`*`).
If required but missing or invalid, the entire `@property` rule is invalid and ignored.
## Syntax
```css
/* Set initial color value */
initial-value: rebeccapurple;
/* Set initial length value */
initial-value: 16px;
```
### Values
A value that matches the type specified in the syntax descriptor.
For example, if `syntax` is `<color>`, then the `initial-value` must be a valid color value.
If the value of the `syntax` descriptor is not the universal syntax definition, the `initial-value` descriptor has to be a [computationally independent](https://drafts.css-houdini.org/css-properties-values-api-1/#computationally-independent) value. This means the value can be converted into a computed value without depending on other values, except for "global" definitions independent of CSS. For example, `10px` is computationally independent—it doesn't change when converted to a computed value. `2in` is also valid, because `1in` is always equivalent to `96px`. However, `3em` is not valid, because the value of an `em` is dependent on the parent's font-size.
## Formal definition
## Formal syntax
## Examples
### Setting an initial value for a custom property
This example shows how to define a custom property `--my-color` with an initial color value of `#c0ffee`. This initial value will be used when the property is not inherited (`inherits: false`) and no other value is set on the element.
```css
@property --my-color {
syntax: "<color>";
inherits: false;
initial-value: #c0ffee;
}
```
Using [JavaScript](/docs/Web/JavaScript) CSS.registerProperty():
```js
window.CSS.registerProperty({
name: "--my-color",
syntax: "<color>",
inherits: false,
initialValue: "#c0ffee",
});
```
## Specifications
## Browser compatibility
## See also
- Other @property descriptors: inherits and syntax
- [Registering CSS custom properties](/docs/Web/CSS/Guides/Properties_and_values_API/Registering_properties)
- [CSS Properties and Values API](/docs/Web/API/CSS_Properties_and_Values_API)
- [CSS Painting API](/docs/Web/API/CSS_Painting_API)
- [CSS Typed Object Model](/docs/Web/API/CSS_Typed_OM_API)
- [Houdini APIs](/docs/Web/API/Houdini_APIs)
Cite this
"`initial-value` CSS at-rule descriptor". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@property/initial-value JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy