-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added detect for
flex-wrap
(Fixes 1048)
- Loading branch information
Showing
3 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/*! | ||
{ | ||
"name": "Flex Line Wrapping", | ||
"property": "flexwrap", | ||
"tags": ["css", "flexbox"], | ||
"notes": [{ | ||
"name": "W3C Flexible Box Layout spec", | ||
"href": "http://dev.w3.org/csswg/css3-flexbox" | ||
}], | ||
"warnings": [ | ||
"Does not imply a modern implementation – see documentation." | ||
] | ||
} | ||
!*/ | ||
/* DOC | ||
Detects support for the `flex-wrap` CSS property, part of Flexbox, which isn’t present in all Flexbox implementations (notably Firefox). | ||
This featured in both the 'tweener' syntax (implemented by IE10) and the 'modern' syntax (implemented by others). This detect will return `true` for either of these implementations, as long as the `flex-wrap` property is supported. So to ensure the modern syntax is supported, use together with `Modernizr.flexbox`: | ||
```javascript | ||
if (Modernizr.flexbox && Modernizr.flexwrap) { | ||
// Modern Flexbox with `flex-wrap` supported | ||
} | ||
else { | ||
// Either old Flexbox syntax, or `flex-wrap` not supported | ||
} | ||
``` | ||
*/ | ||
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) { | ||
Modernizr.addTest('flexbox', testAllProps('flexWrap', 'wrap', true)); | ||
}); |
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