CSSPropertyRule: inherits property
CSSPropertyRule 接口的只读属性 inherits 返回由 @property 规则表示的自定义属性注册的继承标志,该布尔值描述了该属性是否默认继承。
值
布尔值。
示例
此样式表包含一个 @property 规则。返回的第一个 CSSRule 将是表示此规则的 CSSPropertyRule。inherits 属性返回布尔值 false,这是 CSS 中 inherits 属性的值。
css
@property --property-name {
syntax: "<color>";
inherits: false;
initial-value: #c0ffee;
}
js
const myRules = document.styleSheets[0].cssRules;
console.log(myRules[0].inherits); // false
规范
| 规范 |
|---|
| CSS 属性和值 API Level 1 # dom-csspropertyrule-inherits |
浏览器兼容性
加载中…