Conditional rules
The conditional rules module is mostly about the syntax for at-rules such as media queries, @font-face
, and the like. However, it contains the @support
rule which will likelye become more important over time.
This is the mobile table. See also the desktop table.
Last major update on 6 July 2016.
@supports
The first test is only about basic support and syntax: is @supports
supported at all?
Basic support
|
No |
Yes |
No |
Yes |
No |
Yes |
Yes |
No |
Yes |
No |
Yes |
No |
Yes |
@supports (display: block) {
// styles
}
The styles are applied if the CSS parser recognises display: block as a valid value.
|
Specific cases
Let’s review two specific cases. Both show the limits of what @supports
can do. To me, these test cases prove that it’s best to use @supports
only for detecting support for large modules such as flexbox, and not for individual values. That makes it quite a bit less useful.
|
- |
corr |
- |
corr |
- |
corr |
inc |
corr |
inc |
- |
corr |
- |
corr |
- |
inc |
@supports (transition-property: nonsense) . I’d say that the browser should return false, since there is no CSS property nonsense .
However, it seems they must accept any value for this particular property, since it might be a future property that this particular browser does not support in case you try @supports (transition-property: display, nonsense) . I’m not entirely convinced by this argument (if a browser doesn’t support a property it can’t transition it), but it seems to be the official answer.
I assume that rejecting nonsense was the WebKit way of doing things that Blink inherited until it changed behaviour in Chromium 35.
- Inc
- Incorrect: browser says it supports
nonsense .
- Corr
- Correct: browser says it does not support
nonsense .
|
|
- |
inc |
- |
inc |
- |
inc |
corr |
inc |
inc |
- |
inc |
- |
inc |
- |
corr |
Then a more subtle case: @supports (background-attachment: fixed | local) . The point here is that in practice most mobile browsers do not support it; see also the compatibility table. Still, when asked via @support they will say there is no problem. Is this an error? Or merely an expectation that we web developers have?
- Inc
- Incorrect: browser says it supports
background-attachment while in practice it doesn’t.
- Corr
- Correct: browser says it supports
background-attachment and does. (Bugs are ignored.)
|
Tested browsers
- iOS 8
- Default browser on iPhone 4S with iOS 8.3
- iOS 9
- Default browser on iPad 2 with iOS 9.3.2
- iOS 8 WebView
- Chrome/iOS on iPhone 4S with iOS 8.3
- iOS 9 WebView
- Chrome/iOS on iPad 2 with iOS 9.2.1
- Android WebKit 4
- Default browser on Huawei C8813, Android 4.1.1
- Default browser on Samsung Galaxy Note I, Android 4.1.2
- Default browser on Sony Xperia S, Android 4.1.2
- Default browser on LG L5, Android 4.1.2
- Default browser on Wolfgang AT-AS45FW, Android 4.2.2 (see note below)
- Default browser on HTC One X, Android 4.2.2
- Android 4 WebView
- WebView on Samsung Galaxy Note I, Android 4.1.2
- WebView on Sony Xperia S, Android 4.1.2
- WebView on HTC One X, Android 4.2.2
- WebView on Wolfgang AT-AS45FW, Android 4.2.2 (see note below)
- All these WebViews were tested with the HTML5Test Android app.
- Chromium LG 30
- Default browser on LG L70, Android 4.4.2
- Chromium Cyanogen 33
- Default browser on Galaxy Nexus flashed with Cyanogenmod 11, Android 4.4.4
- Chromium HTC 33
- Default browser on HTC M8, Android 6.0
- Chromium Samsung 34
- Default browser on Samsung Galaxy S4, Android 5.0.1
- Chromium Ubuntu 35
- Default browser on Ubuntu Phone 15.04
- Chromium Micromax 39
- Default browser on Micromax Canvas Nitro 3 Android 5.1
- Chromium Samsung 44
- Default browser on Samsung Galaxy S6, Android 5.1.1
- Chromium Xiaomi 46
- Default browser on Xiaomi M2, Android 5.0.2
- Chromium Opera 50
- 34 on LG L5, Android 4.1.2
- Chromium Google 51
- Default browser on Motorola Moto G, Android 5.1
- This is Google’s regular Chrome. I test it only on devices where it is the default browser.
- Chromium WebView 30
- WebView on LG L70, Android 4.4.2
- All these WebViews were tested with the HTML5Test Android app.
- Chromium WebView 33
- WebView on Galaxy Nexus flashed with Cyanogenmod 11, Android 4.4.4
- Chromium WebView 39
- WebView on Micromax Canvas Nitro 3 Android 5.1
- Chromium WebView 45
- WebView on HTC M8, Android 6.0
- Chromium WebView 51
- WebView on Samsung Galaxy S6, Android 5.1.1
- All these WebViews were tested with the HTML5Test Android app.
- UC 10
- UC 10.10.5 on Samsung Galaxy S6, Android 5.1.1
- BlackBerry 10
- Default browser on BlackBerry Z30 (BB OS 10.3.2)
- Dolphin
- Dolphin 11.5.7 with JetPack on Intex Agua Super, Android 5.1.
- Independent full browser for Android, as long as you install both Dolphin and the Jetpack extension.
- It claims to be a Chromium 33, but it lies.
- Opera Mini 11
- 11 on Intex Agua Super, Android 5.1. It is the default browser on this device; that’s why included this old version
- Opera Mini 17
- 15 on Samsung Galaxy S4, Android 5.0.1
- IE11
- Default browser on Nokia Lumia 820, Windows Phone 8.1 “Update”
- This is a developer phone. That might matter.
- Edge 13
- Default browser on Nokia Lumia 830, Windows 10 Mobile
- Firefox Android
- 47 on Motorola Moto G, Android 5.1