-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
document ESM only PostCSS config and ecosystem guides
- Loading branch information
1 parent
3a07891
commit 888b9a0
Showing
3 changed files
with
26 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ yarn add @greenwood/plugin-postcss --dev | |
|
||
Then add this plugin to your _greenwood.config.js_. | ||
|
||
```javascript | ||
```js | ||
import { greenwoodPluginPostCss } from "@greenwood/plugin-postcss"; | ||
|
||
export default { | ||
|
@@ -34,25 +34,14 @@ export default { | |
}; | ||
``` | ||
|
||
To use your own PostCSS configuration, you'll need to create _two (2)_ config files in the root of your project, by which you can provide your own custom plugins / settings that you've installed. | ||
|
||
- _postcss.config.js_ | ||
- _postcss.config.mjs_ | ||
To use your own PostCSS configuration, just create a _postcss.config.js_ file at the root of your project, by which you can provide your own custom plugins / settings that you've installed. | ||
|
||
```js | ||
// postcss.config.mjs | ||
export default { | ||
plugins: [(await import("autoprefixer")).default], | ||
}; | ||
``` | ||
|
||
```js | ||
// postcss.config.js | ||
module.exports = { | ||
plugins: [require("autoprefixer")], | ||
}; | ||
``` | ||
|
||
## Usage | ||
|
||
Now you can write the CSS and see the results of the plugin in the generated styles | ||
|
@@ -66,6 +55,7 @@ Now you can write the CSS and see the results of the plugin in the generated sty | |
.image { | ||
background-image: url([email protected]); | ||
} | ||
|
||
@media (min-resolution: 2dppx) { | ||
.image { | ||
background-image: url([email protected]); | ||
|
@@ -86,6 +76,7 @@ Now you can write the CSS and see the results of the plugin in the generated sty | |
.image { | ||
background-image: url([email protected]); | ||
} | ||
|
||
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) { | ||
.image { | ||
background-image: url([email protected]); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters