1462e022bef50b9c6218e6570d1c86034dfcb6a9936d3932ce3d184cea5994d79316e5dbc10e144de0729c0cfa534448d88028081c33cd057641d25927f01b 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # [postcss][postcss]-colormin [![Build Status](https://travis-ci.org/ben-eb/postcss-colormin.svg?branch=master)][ci] [![NPM version](https://badge.fury.io/js/postcss-colormin.svg)][npm] [![Dependency Status](https://gemnasium.com/ben-eb/postcss-colormin.svg)][deps]
  2. > Minify colors in your CSS files with PostCSS.
  3. ## Install
  4. With [npm](https://npmjs.org/package/postcss-colormin) do:
  5. ```
  6. npm install postcss-colormin --save
  7. ```
  8. ## Example
  9. ```js
  10. var postcss = require('postcss')
  11. var colormin = require('postcss-colormin');
  12. var css = 'h1 {color: rgba(255, 0, 0, 1)}';
  13. console.log(postcss(colormin()).process(css).css);
  14. // => 'h1 {color:red}'
  15. ```
  16. For more examples see the [tests](src/__tests__/index.js).
  17. ## API
  18. ### colormin([options])
  19. #### options
  20. ##### legacy
  21. Type: `boolean`
  22. Default: `false`
  23. Set this to `true` to enable IE < 10 compatibility; the browser chokes on the
  24. `transparent` keyword, so in this mode the conversion from `rgba(0,0,0,0)`
  25. is turned off.
  26. ## Contributing
  27. Pull requests are welcome. If you add functionality, then please add unit tests
  28. to cover it.
  29. ## License
  30. MIT © [Ben Briggs](http://beneb.info)
  31. [ci]: https://travis-ci.org/ben-eb/postcss-colormin
  32. [deps]: https://gemnasium.com/ben-eb/postcss-colormin
  33. [npm]: http://badge.fury.io/js/postcss-colormin
  34. [postcss]: https://github.com/postcss/postcss