Browse Source
Merge pull request #22 from evrone/update-readme
update readme
pull/23/head
Dmitry Karpunin
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
18 additions and
1 deletions
-
README.md
|
|
@ -2,6 +2,11 @@ |
|
|
|
|
|
|
|
A plugin for [PostCSS](https://github.com/ai/postcss) that generates viewport units (vw, vh, vmin, vmax) from pixel units. |
|
|
|
|
|
|
|
## Install |
|
|
|
``` |
|
|
|
$ npm install postcss-px-to-viewport --save-dev |
|
|
|
``` |
|
|
|
|
|
|
|
## Usage |
|
|
|
|
|
|
|
If your project involves a fixed width, this script will help to convert pixels into viewport units. |
|
|
@ -117,7 +122,7 @@ Default: |
|
|
|
- If value is array, the elements of the array are regexp. |
|
|
|
|
|
|
|
### Use with gulp-postcss |
|
|
|
|
|
|
|
add to your gulp config: |
|
|
|
```js |
|
|
|
var gulp = require('gulp'); |
|
|
|
var postcss = require('gulp-postcss'); |
|
|
@ -137,3 +142,15 @@ gulp.task('css', function () { |
|
|
|
.pipe(gulp.dest('build/css')); |
|
|
|
}); |
|
|
|
``` |
|
|
|
### Use with Postcss configuration file |
|
|
|
add to postcss.config.js |
|
|
|
```js |
|
|
|
module.exports = { |
|
|
|
plugins: { |
|
|
|
... |
|
|
|
'postcss-px-to-viewport': { |
|
|
|
// options |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
``` |