Path: blob/main/files/en-us/web/css/@property/inherits/index.md
6520 views
------{{CSSRef}}{{SeeCompatTable}}
The inherits CSS descriptor is required when using the {{cssxref("@property")}} at-rule and controls whether the custom property registration specified by @property inherits by default.
Syntax
Values
true: The property inherits by default.
false: The property does not inherit by default.
Formal definition
{{cssinfo}}
Formal syntax
{{csssyntax}}
Examples
Add type checking to --my-color {{cssxref('--*', 'custom property')}}, as a color, a default value, and not allow it to inherit its value:
Using CSS {{cssxref('@property')}} at-rule:
Using JavaScript {{domxref('CSS.registerProperty')}}:
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}