-
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.
Revised version of nativeCSSDetect - this time only allows `(prop, va…
…lue)` interface, because it's probably more common. Also updated `flexbox` and `flexboxlegacy` tests to show how it could be used.
- Loading branch information
Showing
3 changed files
with
46 additions
and
14 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) { | ||
define(['Modernizr', 'testAllProps', 'nativeCSSDetect'], function( Modernizr, testAllProps, nativeCSSDetect ) { | ||
// The *new* flexbox | ||
// dev.w3.org/csswg/css3-flexbox | ||
Modernizr.addTest('flexbox', testAllProps('flexWrap')); | ||
Modernizr.addTest('flexbox', function () { | ||
var result = nativeCSSDetect('flex-wrap', 'wrap', true); | ||
if (typeof result !== 'undefined') { | ||
return result; | ||
} | ||
// Failing that, do it the old way | ||
return testAllProps('flexWrap'); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -1,5 +1,12 @@ | ||
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) { | ||
define(['Modernizr', 'testAllProps', 'nativeCSSDetect'], function( Modernizr, testAllProps, nativeCSSDetect ) { | ||
// The *old* flexbox | ||
// www.w3.org/TR/2009/WD-css3-flexbox-20090723/ | ||
Modernizr.addTest('flexboxlegacy', testAllProps('boxDirection')); | ||
Modernizr.addTest('flexboxlegacy', function () { | ||
var result = nativeCSSDetect('box-direction', 'reverse', true); | ||
if (typeof result !== 'undefined') { | ||
return result; | ||
} | ||
// Failing that, do it the old way | ||
return testAllProps('boxDirection'); | ||
}); | ||
}); |
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