Skip to content

Instantly share code, notes, and snippets.

@englishextra
Forked from davidhund/feature-detect flexbox.js
Created February 28, 2017 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save englishextra/d532c9e53f420ee4a6e7488834863952 to your computer and use it in GitHub Desktop.
Save englishextra/d532c9e53f420ee4a6e7488834863952 to your computer and use it in GitHub Desktop.
The simplest feature-detect for flexbox?
/*
* Trying to feature-detect (very naive)
* CSS Flexbox support.
* - Only most modern syntax
*
* Is this nonsense?
*/
(function NaiveFlexBoxSupport(d){
var f = "flex", e = d.createElement('b');
e.style.display = f;
return e.style.display == f;
})(document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment