Skip to content

Commit 26bfc1d

Browse files
committed
update README
1 parent dded352 commit 26bfc1d

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

README.md

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,47 @@
11
# npm-css
22

3-
Require css from npm
4-
5-
## CLI
6-
7-
`npm-css entry.css -o bundle.css`
3+
Require css from node modules.
84

95
## Syntax
106

117
``` css
128
/*
13-
@require foo.css
9+
@require typeahead
10+
11+
@require ./foo.css
1412
@require ./bar/baz.css
15-
@require readable
1613
*/
1714

1815
.foo {
1916
color: red
2017
}
2118
```
2219

23-
npm-css reads comments in the format of `// @require` and inlines
24-
the CSS at that path for you. It also understands node modules.
20+
npm-css reads comments in the format of `// @require` and inlines the CSS at that path for you. It also understands node modules.
21+
22+
If you `@require` a folder it will try to look for a package.json file or read `index.css` by default. See the `package.json` section below.
23+
24+
## CLI
25+
26+
To build a single css file from an entry.css with @require statements.
27+
28+
`npm-css entry.css -o bundle.css`
29+
30+
## API
2531

26-
If you `@require` a folder it will read `index.css` by default
32+
If you want to build css files on the fly.
33+
34+
```javascript
35+
var npmcss = require('npm-css');
36+
var css = npmcss(/path/to/file);
37+
```
2738

2839
## package.json
2940

30-
If you publish a module on npm with CSS you can add the `"css"`
31-
field to your package.json to set a different entry point then
32-
`index.css`. This works similarly to the `"main"` field
41+
You can specify the stylesheet for your module by adding a `"style"` field to your package.json file. This works similarly to the `"main"` field.
3342

3443
## Installation
3544

3645
`npm install npm-css`
3746

38-
## Contributors
39-
40-
- Raynos
41-
4247
## MIT Licenced

0 commit comments

Comments
 (0)