CSSImportRule: stylesheet プロパティ
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
styleSheet
は CSSImportRule
インターフェイスの読み取り専用プロパティで、 @import
アットルールによって指定された CSS スタイルシートを返します。これは CSSStyleSheet
オブジェクトの形です。
値
CSSStyleSheet
です。
例
このスタイルシートは単一の @import
ルールが記載されています。したがって、 CSS ルールのリストの最初の項目は CSSImportRule
になります。 styleSheet
プロパティはインポートされたスタイルシートを返します。
css
@import url("style.css") screen;
js
let myRules = document.styleSheets[0].cssRules;
console.log(myRules[0].styleSheet); // CSSStyleSheet オブジェクトを返す
仕様書
Specification |
---|
CSS Object Model (CSSOM) # dom-cssimportrule-stylesheet |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
styleSheet |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.