A feature detection element based on modernizr.
Install the component using Bower:
$ bower install modernizr-element --save
In order for the element to provide its feature detection functionality, a javascript file named modernizr-custom.js
need to be generated.
This file will include all the tests available for feature detection by the modernizr-element
.
Once the file has been produced, you will need to copy the file in the same folder as the modernizr-element.html
. (e.g. path/to/bower_components/modernizr/
)
There are several ways to produce the modernizr-custom.js
file:
- Using the Modernizr website download feature.
- Using
modernizr
in your gulp file:
gulp.task('modernizr', function(cb) {
var detects = [
'adownload',
'blobconstructor',
'flash'
].join();
var output = 'frontend/js/modernizr.custom.js';
return exec('./node_modules/.bin/modernizr -f ' + detects + ' -d ' + output,
cb
);
});
- Using the
gulp-modernizr
Note: the element contains by default a full build which should NOT be used in production.
Import Custom Element:
<link rel="import" href="bower_components/modernizr-element/modernizr-element.html">
And then use it:
<modernizr-element geolocation="{{_geolocation}}"></modernizr-element>
<p>Feature geolocation is : {{_geolocation}}</p>
See the Documentation for more options.
https://geoloeg.github.io/modernizr-element/
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D