Skip to content

Commit 1738250

Browse files
Update README.md
Improve documentation by adding links to the npm package page,
1 parent e8ed0a1 commit 1738250

1 file changed

Lines changed: 34 additions & 16 deletions

File tree

README.md

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1-
# postcss-calc [![Build Status](https://travis-ci.org/postcss/postcss-calc.png)](https://travis-ci.org/postcss/postcss-calc)
1+
# PostCSS Calc [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS" width="90" height="90" align="right">][PostCSS]
22

3-
> [PostCSS](https://github.com/postcss/postcss) plugin to reduce `calc()`.
3+
[![NPM Version][npm-img]][npm-url]
4+
[![Build Status][cli-img]][cli-url]
5+
[![Support Chat][git-img]][git-url]
46

5-
This plugin reduce `calc()` references whenever it's possible.
6-
This can be particularly useful with the [postcss-custom-properties](https://github.com/postcss/postcss-custom-properties) plugin.
7+
[PostCSS Calc] lets you reduce `calc()` references whenever it's possible. This
8+
can be particularly useful with the [PostCSS Custom Properties] plugin.
79

8-
**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).
10+
When multiple units are mixed together in the same expression, the `calc()`
11+
statement is left as is, to fallback to the [W3C calc() implementation].
912

1013
## Installation
1114

12-
```console
13-
$ npm install postcss-calc
15+
```bash
16+
npm install postcss-calc
1417
```
1518

1619
## Usage
@@ -31,7 +34,7 @@ var output = postcss()
3134
.css
3235
```
3336

34-
**Example** (with [postcss-custom-properties](https://github.com/postcss/postcss-custom-properties) enabled as well):
37+
**Example** (with [PostCSS Custom Properties] enabled as well):
3538

3639
```js
3740
// dependencies
@@ -86,7 +89,7 @@ h1 {
8689
}
8790
```
8891

89-
Checkout [tests](src/__tests__/index.js) for more examples.
92+
Checkout [tests] for more examples.
9093

9194
### Options
9295

@@ -103,7 +106,8 @@ var out = postcss()
103106

104107
#### `preserve` (default: `false`)
105108

106-
Allow you to preserve calc() usage in output so browsers will handle decimal precision themselves.
109+
Allow you to preserve calc() usage in output so browsers will handle decimal
110+
precision themselves.
107111

108112
```js
109113
var out = postcss()
@@ -157,15 +161,29 @@ div[data-size="calc(3*3)"] {
157161

158162
## Contributing
159163

160-
Work on a branch, install dev-dependencies, respect coding style & run tests before submitting a bug fix or a feature.
164+
Work on a branch, install dev-dependencies, respect coding style & run tests
165+
before submitting a bug fix or a feature.
161166

162-
```console
163-
$ git clone https://github.com/postcss/postcss-calc.git
164-
$ git checkout -b patch-1
165-
$ npm install
166-
$ npm test
167+
```bash
168+
git clone git@github.com:postcss/postcss-calc.git
169+
git checkout -b patch-1
170+
npm install
171+
npm test
167172
```
168173

169174
## [Changelog](CHANGELOG.md)
170175

171176
## [License](LICENSE)
177+
178+
[cli-img]: https://img.shields.io/travis/postcss/postcss-calc/master.svg
179+
[cli-url]: https://travis-ci.org/postcss/postcss-calc
180+
[git-img]: https://img.shields.io/badge/support-chat-blue.svg
181+
[git-url]: https://gitter.im/postcss/postcss
182+
[npm-img]: https://img.shields.io/npm/v/postcss-calc.svg
183+
[npm-url]: https://www.npmjs.com/package/postcss-calc
184+
185+
[PostCSS]: https://github.com/postcss
186+
[PostCSS Calc]: https://github.com/postcss/postcss-calc
187+
[PostCSS Custom Properties]: https://github.com/postcss/postcss-custom-properties
188+
[tests]: src/__tests__/index.js
189+
[W3C calc() implementation]: https://www.w3.org/TR/css3-values/#calc-notation

0 commit comments

Comments
 (0)