diff --git a/README.md b/README.md index 4cabf73..9cd9252 100755 --- a/README.md +++ b/README.md @@ -1,16 +1,19 @@ -# postcss-calc [![Build Status](https://travis-ci.org/postcss/postcss-calc.png)](https://travis-ci.org/postcss/postcss-calc) +# PostCSS Calc [PostCSS][PostCSS] -> [PostCSS](https://github.com/postcss/postcss) plugin to reduce `calc()`. +[![NPM Version][npm-img]][npm-url] +[![Build Status][cli-img]][cli-url] +[![Support Chat][git-img]][git-url] -This plugin reduce `calc()` references whenever it's possible. -This can be particularly useful with the [postcss-custom-properties](https://github.com/postcss/postcss-custom-properties) plugin. +[PostCSS Calc] lets you reduce `calc()` references whenever it's possible. This +can be particularly useful with the [PostCSS Custom Properties] plugin. -**Note:** When multiple units are mixed together in the same expression, the `calc()` statement is left as is, to fallback to the [w3c calc() feature](http://www.w3.org/TR/css3-values/#calc). +When multiple units are mixed together in the same expression, the `calc()` +statement is left as is, to fallback to the [W3C calc() implementation]. ## Installation -```console -$ npm install postcss-calc +```bash +npm install postcss-calc ``` ## Usage @@ -31,7 +34,7 @@ var output = postcss() .css ``` -**Example** (with [postcss-custom-properties](https://github.com/postcss/postcss-custom-properties) enabled as well): +**Example** (with [PostCSS Custom Properties] enabled as well): ```js // dependencies @@ -86,7 +89,7 @@ h1 { } ``` -Checkout [tests](src/__tests__/index.js) for more examples. +Checkout [tests] for more examples. ### Options @@ -103,7 +106,8 @@ var out = postcss() #### `preserve` (default: `false`) -Allow you to preserve calc() usage in output so browsers will handle decimal precision themselves. +Allow you to preserve calc() usage in output so browsers will handle decimal +precision themselves. ```js var out = postcss() @@ -157,15 +161,29 @@ div[data-size="calc(3*3)"] { ## Contributing -Work on a branch, install dev-dependencies, respect coding style & run tests before submitting a bug fix or a feature. +Work on a branch, install dev-dependencies, respect coding style & run tests +before submitting a bug fix or a feature. -```console -$ git clone https://github.com/postcss/postcss-calc.git -$ git checkout -b patch-1 -$ npm install -$ npm test +```bash +git clone git@github.com:postcss/postcss-calc.git +git checkout -b patch-1 +npm install +npm test ``` ## [Changelog](CHANGELOG.md) ## [License](LICENSE) + +[cli-img]: https://img.shields.io/travis/postcss/postcss-calc/master.svg +[cli-url]: https://travis-ci.org/postcss/postcss-calc +[git-img]: https://img.shields.io/badge/support-chat-blue.svg +[git-url]: https://gitter.im/postcss/postcss +[npm-img]: https://img.shields.io/npm/v/postcss-calc.svg +[npm-url]: https://www.npmjs.com/package/postcss-calc + +[PostCSS]: https://github.com/postcss +[PostCSS Calc]: https://github.com/postcss/postcss-calc +[PostCSS Custom Properties]: https://github.com/postcss/postcss-custom-properties +[tests]: src/__tests__/index.js +[W3C calc() implementation]: https://www.w3.org/TR/css3-values/#calc-notation