ShadowRoot.styleSheets

styleSheetsShadowRoot インターフェイスの読み取り専用プロパティで、シャドウツリーに明示的にリンクされるか埋め込まれたスタイルシートを表す 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