With Modernizr you don't bother checking for specific browser versions. Modernizr uses JavaScript to add classes to the html element of the user's page. If the user's browser supports a feature, Modernizr will add a class with the name of that feature. If the user's browser does not support a feature, Modernizr will add a class 'no-' + feature-name. You write your css or JavaScript to check if the html element contains the class of the feature you want to support.
/* For all browsers */
.foo {
display: inline-block;
}
/* For browsers that support Flexbox */
.flexbox .foo {
display: flex;
}
/* For browsers that don't support Flexbox. I never use the 'no' classes
as I add features, not remove them. */
.no-flexbox .foo {
display: inline-block;
}
Ideally it should never be a 'pass' or 'fail' situation. You should try to support older browsers the best you can, adding extra functionality and features for those that use the latest browser versions.
Here is the breakdown of the Modernizr Flexbox options:
- Flexbox - browsers that support the current syntax (display: flex;)
- Flexbox (legacy) - browsers that support the old 2009 syntax (display: box;)
- Flexbox (tweener) - IE 10 (display: flexbox;)
If you are starting from scratch then you don't need 2 & 3. Those would be used to support sites built before the syntax was ironed out.
Deciding which Modernizr features to include depends on the features you plan to use. You should just start off using the full Modernizr library, then when you have completed your site, go back and build a reduced version using only the features you ended up using in your code.