Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/geoloeg/modernizr-element
[Polymer 1.x] A feature detection element powered by `Modernizr`
https://github.com/geoloeg/modernizr-element
feature-detection modernizr polymer polymer-element webcomponents
Last synced: 21 days ago
JSON representation
[Polymer 1.x] A feature detection element powered by `Modernizr`
- Host: GitHub
- URL: https://github.com/geoloeg/modernizr-element
- Owner: GeoloeG
- License: mit
- Created: 2016-04-04T13:46:51.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-08T14:30:56.000Z (almost 8 years ago)
- Last Synced: 2024-11-10T08:39:34.984Z (about 1 month ago)
- Topics: feature-detection, modernizr, polymer, polymer-element, webcomponents
- Language: JavaScript
- Homepage:
- Size: 2.57 MB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg?style=flat-square)](https://www.webcomponents.org/element/GeoloeG/modernizr-element)
# ``
## Descripton
A feature detection element based on [modernizr](https://modernizr.com/).
## Install
Install the component using [Bower](http://bower.io/):
```sh
$ bower install modernizr-element --save
```## Generating your `modernizr-custom.js` file
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:
1. Using the [Modernizr website](https://modernizr.com/download?setclasses) download feature.
2. Using `modernizr` in your gulp file:
```javascript
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
);
});
```
3. Using the [`gulp-modernizr`](https://github.com/doctyper/gulp-modernizr)Note: the element contains by default a full build which should NOT be used in production.
## Usage
Import Custom Element:
```html
```
And then use it:
```html
Feature geolocation is : {{_geolocation}}
```See the [Documentation](https://geoloeg.github.io/modernizr-element/) for more options.
## More Demos
[https://geoloeg.github.io/modernizr-element/](https://geoloeg.github.io/modernizr-element/components/modernizr-element/demo/)
## Contributing
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -m 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D