CSS Conditional Rules
CSS Conditional Rules is a CSS module that allows to define a set of rules that will only apply based on the capabilities of the processor or the document the style sheet is being applied to.
Reference
At-rules
Specifications
@document
rule
|
Desktop |
|
Chrome |
Edge |
Firefox |
Internet Explorer |
Opera |
Safari |
Basic support
|
No |
? |
61 Prefixed Disabled
- 61
Prefixed Disabled
- Prefixed Requires the vendor prefix: -moz-
- Disabled by default in web pages, except for an empty
url-prefix() value, which is supported due to its use in Firefox browser detection. Still supported in user stylesheets.
- Disabled From version 61: this feature is behind the
layout.css.moz-document.content.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
- 1.5 — 61
Prefixed
- Prefixed Requires the vendor prefix: -moz-
|
No |
No |
No |
regexp()
|
No |
? |
6 |
No |
No |
No |
|
Mobile |
|
Android webview |
Chrome for Android |
Edge Mobile |
Firefox for Android |
Opera for Android |
iOS Safari |
Samsung Internet |
Basic support
|
? |
? |
? |
? |
? |
? |
No |
regexp()
|
No |
No |
? |
? |
No |
No |
No |
@import
rule
|
Desktop |
|
Chrome |
Edge |
Firefox |
Internet Explorer |
Opera |
Safari |
Basic support |
Yes |
Yes |
Yes |
5.5 |
Yes |
Yes |
|
Mobile |
|
Android webview |
Chrome for Android |
Edge Mobile |
Firefox for Android |
Opera for Android |
iOS Safari |
Samsung Internet |
Basic support |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Legend
- Full support
- No support
- Compatibility unknown
- Compatibility unknown
- Experimental. Expect behavior to change in the future.
- Non-standard. Expect poor cross-browser support.
- Deprecated. Not for use in new websites.
- See implementation notes.
- See implementation notes.
- User must explicitly enable this feature.
- User must explicitly enable this feature.
@supports
rule
|
Desktop |
|
Chrome |
Edge |
Firefox |
Internet Explorer |
Opera |
Safari |
Basic support |
28 |
12 |
22
- 22
- 17 — ?
Disabled
- Disabled From version 17: this feature is behind the
layout.css.supports-rule.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
|
No |
12.1 |
9 |
selector()
|
No |
No |
64 Disabled
- 64
Disabled
- Disabled From version 64: this feature is behind the
layout.css.supports-selector.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
|
No |
No |
No |
|
Mobile |
|
Android webview |
Chrome for Android |
Edge Mobile |
Firefox for Android |
Opera for Android |
iOS Safari |
Samsung Internet |
Basic support |
Yes |
28 |
Yes |
22
- 22
- 17 — ?
Disabled
- Disabled From version 17: this feature is behind the
layout.css.supports-rule.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
|
12.1 |
9 |
Yes |
selector()
|
No |
No |
No |
64 Disabled
- 64
Disabled
- Disabled From version 64: this feature is behind the
layout.css.supports-selector.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
|
No |
No |
No |
Legend
- Full support
- No support
- Experimental. Expect behavior to change in the future.
- User must explicitly enable this feature.
- User must explicitly enable this feature.