CSSPropertyRule: inherits プロパティ

Baseline 2024
Newly available

Since July 2024, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

inheritsCSSPropertyRule インターフェイスの読み取り専用プロパティで、 @property ルールで表現されているカスタムプロパティ登録の継承フラグ、つまり、そのプロパティが既定値では継承されるかどうかを記述した論理値を返します。

論理値です。

このスタイルシートには、単一の @property ルールが格納されています。最初に返される CSSRule は、このルールを表す CSSPropertyRule となります。 inherits プロパティは論理値 false を返します。これは CSS の inherits プロパティの値です。

css
@property --property-name {
  syntax: "<color>";
  inherits: false;
  initial-value: #c0ffee;
}
js
let myRules = document.styleSheets[0].cssRules;
console.log(myRules[0].inherits); //returns false

仕様書

Specification
CSS Properties and Values API Level 1
# dom-csspropertyrule-inherits

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
inherits

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support