css2modernizr
Creates a Modernizr config file that requires only the tests that your CSS uses.
Install
As command line tool:
$ npm install -g css2modernizr
If you haven't sufficient permissions may be you should use sudo
As node.js module for using in your project:
$ npm install --save css2modernizr
Usage
As command line tool:
$ css2modernizr /path/to/your/css/file.css
Or if you use Modernizr's prefixes in your css:
$ css2modernizr --prefix prfx- /path/to/your/css/file.css
Where prfx-
is part in class name .prfx-no-flexbox
or .prfx-rgba
As node.js module:
var css2modernizr = ;var result = ;
Example
Let's imagine we have the following CSS:
If you run css2modernizr
on this CSS, then result will be:
$ ./bin/css2modernizr test/example.css develop [2deb29d] modified untracked No prefix ┌───────────────┬─────────────────┐│ Name │ Count of usages │├───────────────┼─────────────────┤│ csstransforms │ 2 │├───────────────┼─────────────────┤│ flexbox │ 1 │├───────────────┼─────────────────┤│ rgba │ 1 │├───────────────┼─────────────────┤│ boxshadow │ 1 │└───────────────┴─────────────────┘ Download your Modernizr custom build by URL:http://modernizr.com/download/#-boxshadow-csstransforms-domprefixes-flexbox-rgba-testallprops-testprop
API
(Coming soon)
Contributing
Release History
0.1.0
- Fixed bug with
lastIndex
in regular expression. - Update dependencies:
- PostCSS to 5.0.12
- lodash to 3.10.1
- Example is added to README.
0.0.X
- Initial releases, just CLI-tool, without main idea.
License
Copyright © 2014—2015 Vladimir Bolshakov. Licensed under the MIT license.