CSSImportRule: supportsText property
The read-only supportsText
property of the CSSImportRule
interface returns the supports condition specified by the @import
at-rule.
Value
Examples
The document's single stylesheet contains three @import
rules. The first declaration imports a stylesheet if display: flex
is supported. The second declaration imports a stylesheet if the :has
selector is supported. The third declaration imports a stylesheet without a supports condition.
The supportsText
property returns the import conditions associated with the at-rule.
@import url("style1.css") supports(display: flex);
@import url("style2.css") supports(selector(p:has(a)));
@import url("style3.css");
const myRules = document.styleSheets[0].cssRules;
console.log(myRules[0].supportsText);
console.log(myRules[1].supportsText);
console.log(myRules[2].supportsText);
Specifications
Browser compatibility
|
Desktop |
Mobile |
|
Chrome |
Edge |
Firefox |
Internet Explorer |
Opera |
Safari |
WebView Android |
Chrome Android |
Firefox for Android |
Opera Android |
Safari on IOS |
Samsung Internet |
supportsText |
No |
No |
114 |
No |
No |
No |
No |
No |
114 |
No |
No |
No |
See also