File tree 1 file changed +22
-17
lines changed
1 file changed +22
-17
lines changed Original file line number Diff line number Diff line change 1
1
# npm-css
2
2
3
- Require css from npm
4
-
5
- ## CLI
6
-
7
- ` npm-css entry.css -o bundle.css `
3
+ Require css from node modules.
8
4
9
5
## Syntax
10
6
11
7
``` css
12
8
/*
13
- @require foo.css
9
+ @require typeahead
10
+
11
+ @require ./foo.css
14
12
@require ./bar/baz.css
15
- @require readable
16
13
*/
17
14
18
15
.foo {
19
16
color : red
20
17
}
21
18
```
22
19
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
25
31
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
+ ```
27
38
28
39
## package.json
29
40
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.
33
42
34
43
## Installation
35
44
36
45
` npm install npm-css `
37
46
38
- ## Contributors
39
-
40
- - Raynos
41
-
42
47
## MIT Licenced
You can’t perform that action at this time.
0 commit comments