Created
January 8, 2016 23:31
-
-
Save tomkeays/98a2a711eb2608c1446c to your computer and use it in GitHub Desktop.
JavaScript test to see if browser supports flexbox
This file contains 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
// via Ethan Marcotte (10 December 2015) | |
// https://24ways.org/2015/putting-my-patterns-through-their-paces/ | |
// If the browser passes the test, then a class of supports-flex gets applied to our html element. | |
var doc = document.body || document.documentElement; | |
var style = doc.style; | |
if ( style.webkitFlexWrap == '' || | |
style.msFlexWrap == '' || | |
style.flexWrap == '' ) { | |
doc.className += " supports-flex"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment