flexwrap.js 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. /*!
  2. {
  3. "name": "Flex Line Wrapping",
  4. "property": "flexwrap",
  5. "tags": ["css", "flexbox"],
  6. "notes": [{
  7. "name": "W3C Spec",
  8. "href": "https://www.w3.org/TR/css-flexbox-1/"
  9. }],
  10. "warnings": [
  11. "Does not imply a modern implementation – see documentation."
  12. ]
  13. }
  14. !*/
  15. /* DOC
  16. Detects support for the `flex-wrap` CSS property, part of Flexbox, which isn’t present in all Flexbox implementations (notably Firefox).
  17. 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`:
  18. ```javascript
  19. if (Modernizr.flexbox && Modernizr.flexwrap) {
  20. // Modern Flexbox with `flex-wrap` supported
  21. }
  22. else {
  23. // Either old Flexbox syntax, or `flex-wrap` not supported
  24. }
  25. ```
  26. */
  27. define(['Modernizr', 'testAllProps'], function(Modernizr, testAllProps) {
  28. Modernizr.addTest('flexwrap', testAllProps('flexWrap', 'wrap', true));
  29. });