Path: blob/main/files/en-us/web/css/--_star_/index.md
6540 views
------{{CSSRef}}
Property names that are prefixed with --, like --example-name, represent custom properties that contain a value that can be used in other declarations using the {{cssxref("var", "var()")}} function.
Custom properties are scoped to the element(s) they are declared on, and participate in the cascade: the value of such a custom property is that from the declaration decided by the cascading algorithm.
{{CSSInfo}}
Syntax
<declaration-value>: This value matches any sequence of one or more tokens, so long as the sequence does not contain an disallowed token. It represents the entirety of what a valid declaration can have as its value.
Note: Custom property names are case sensitive —
--my-colorwill be treated as a separate custom property to--My-color.
Example
HTML
CSS
Result
{{EmbedLiveSample('Example', 500, 130)}}
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
The {{cssxref("var", "var()")}} function