ShadowRoot.styleSheets
styleSheets は ShadowRoot インターフェイスの読み取り専用プロパティで、シャドウツリーに明示的にリンクされるか埋め込まれたスタイルシートを表す CSSStyleSheet オブジェクトの StyleSheetList を返します。
構文
js
shadowRoot.styleSheets
値
CSSStyleSheet オブジェクトの StyleSheetList です。
例
js
let customElem = document.querySelector('my-shadow-dom-element');
let shadow = customElem.shadowRoot;
let styleSheets = shadow.styleSheets;
仕様書
| Specification |
|---|
| CSS Object Model (CSSOM) # dom-documentorshadowroot-stylesheets |
ブラウザーの互換性
BCD tables only load in the browser