@@ -44,9 +44,9 @@ $ npm install postcss-import
4444
4545## Usage
4646
47- If your stylesheets are not in the same place where you run postcss
47+ Unless your stylesheet is in the same place where you run postcss
4848(` process.cwd() ` ), you will need to use ` from ` option to make relative imports
49- work from input dirname .
49+ work.
5050
5151``` js
5252// dependencies
@@ -61,7 +61,7 @@ var css = fs.readFileSync("css/input.css", "utf8")
6161postcss ()
6262 .use (atImport ())
6363 .process (css, {
64- // `from` option is required so relative import can work from input dirname
64+ // `from` option is needed here
6565 from: " css/input.css"
6666 })
6767 .then (function (result ) {
@@ -71,16 +71,16 @@ postcss()
7171 })
7272```
7373
74- Using this ` input.css ` :
74+ ` css/ input.css` :
7575
7676``` css
7777/* can consume `node_modules`, `web_modules` or local modules */
78- @import " cssrecipes-defaults" ; /* == @import "./node_modules/cssrecipes-defaults/index.css"; */
79- @import " normalize.css" ; /* == @import "./node_modules/normalize.css/normalize.css"; */
78+ @import " cssrecipes-defaults" ; /* == @import ".. /node_modules/cssrecipes-defaults/index.css"; */
79+ @import " normalize.css" ; /* == @import ".. /node_modules/normalize.css/normalize.css"; */
8080
81- @import " css/ foo.css" ; /* relative to stylesheets / according to `from` option above */
81+ @import " foo.css" ; /* relative to css / according to `from` option above */
8282
83- @import " css/ bar.css" (min-width : 25em );
83+ @import " bar.css" (min-width : 25em );
8484
8585body {
8686 background : black ;
@@ -90,21 +90,21 @@ body {
9090will give you:
9191
9292``` css
93- /* ... content of ./node_modules/cssrecipes-defaults/index.css */
94- /* ... content of ./node_modules/normalize.css/normalize.css */
93+ /* ... content of .. /node_modules/cssrecipes-defaults/index.css */
94+ /* ... content of .. /node_modules/normalize.css/normalize.css */
9595
96- /* ... content of foo.css */
96+ /* ... content of css/ foo.css */
9797
9898@media (min-width : 25em ) {
99- /* ... content of bar.css */
99+ /* ... content of css/ bar.css */
100100}
101101
102102body {
103103 background : black ;
104104}
105105```
106106
107- Checkout [ tests] ( test ) for more examples.
107+ Checkout the [ tests] ( test ) for more examples.
108108
109109### Options
110110
0 commit comments