Created
February 27, 2015 22:13
-
-
Save AllThingsSmitty/ae74c7dc1ec413edbe26 to your computer and use it in GitHub Desktop.
CSS feature detection using feature queries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
@supports(test condition) { | |
apply rules | |
} | |
@supports not(test condition) { | |
apply rules | |
} | |
*/ | |
/* use CSS variable */ | |
@supports (background-color: var(--bg-color)) { /* support: http://caniuse.com/#feat=css-variables */ | |
body { | |
background-color: var(--bg-color); | |
} | |
} | |
@supports not(background-color: var(--bg-color)) { | |
body { | |
background-color: #ff6347; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment