You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
589 B

4 years ago
  1. # css-unit-converter [![Build Status][ci-img]][ci]
  2. Converts CSS values from one unit to another
  3. [PostCSS]: https://github.com/postcss/css-unit-converter
  4. [ci-img]: https://travis-ci.org/andyjansson/css-unit-converter.svg
  5. [ci]: https://travis-ci.org/andyjansson/css-unit-converter
  6. ## Installation
  7. ```js
  8. npm install css-unit-converter
  9. ```
  10. ## Usage
  11. ```js
  12. var convert = require('css-unit-converter');
  13. //convert 1 inch to pc
  14. convert(1, 'in', 'pc'); // 6
  15. //convert 10px to cm with a maximum of 10 decimals
  16. convert(10, 'px', 'cm', 10); // 0.2645833333
  17. ```