--
This commit is contained in:
parent
24f3d27984
commit
6b60015c02
9588 changed files with 1149251 additions and 49 deletions
81
node_modules/rework-import/README.md
generated
vendored
Normal file
81
node_modules/rework-import/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
# rework-import [](https://travis-ci.org/reworkcss/rework-import)
|
||||
|
||||
> Import stylesheets using `@import` and an optional media query
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
$ npm install --save rework-import
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var data = require('fs').readFileSync('index.css');
|
||||
var imprt = require('rework-import');
|
||||
var rework = require('rework');
|
||||
|
||||
rework(data)
|
||||
.use(imprt({path: 'app/stylesheets'}))
|
||||
.toString();
|
||||
```
|
||||
|
||||
|
||||
## Options
|
||||
|
||||
### encoding
|
||||
|
||||
Type: `String`
|
||||
Default: `utf8`
|
||||
|
||||
Use if your CSS is encoded in anything other than `UTF-8`.
|
||||
|
||||
### path
|
||||
|
||||
Type: `Array|String`
|
||||
Default: `process.cwd()` or `__dirname` of [the rework source](https://github.com/reworkcss/css#cssparsecode-options)
|
||||
|
||||
A string or an array of paths in where to look for files.
|
||||
|
||||
_Note: nested `@import` will additionally benefit of the relative dirname of imported files._
|
||||
|
||||
### transform
|
||||
|
||||
Type: `Function`
|
||||
|
||||
A function to transform the content of imported files. Takes one argument and should return the modified content. Useful if you use [`css-whitespace`](https://github.com/reworkcss/css-whitespace).
|
||||
|
||||
## Example
|
||||
|
||||
```css
|
||||
@import 'foo.css' (min-width: 25em);
|
||||
|
||||
body {
|
||||
background: black;
|
||||
}
|
||||
```
|
||||
|
||||
yields:
|
||||
|
||||
```css
|
||||
@media (min-width: 25em) {
|
||||
body {
|
||||
background: red;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: grey;
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
background: black;
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Jason Campbell](https://github.com/jxson) and [Kevin Mårtensson](http://github.com/kevva)
|
||||
Loading…
Reference in a new issue