Skip to content

Instantly share code, notes, and snippets.

@AllThingsSmitty
Created February 27, 2015 22:13
Show Gist options
  • Save AllThingsSmitty/ae74c7dc1ec413edbe26 to your computer and use it in GitHub Desktop.
Save AllThingsSmitty/ae74c7dc1ec413edbe26 to your computer and use it in GitHub Desktop.
CSS feature detection using feature queries
/*
@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