-
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.
update PostCSS plugin docs for ESM only configuration
- Loading branch information
1 parent
f4a6db1
commit 44f75d5
Showing
1 changed file
with
5 additions
and
14 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,22 +34,11 @@ 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, you'll want to create your own _postcss.config.js_ file at the root of your project, by which you can provide your own [custom plugins and settings](https://github.com/postcss/postcss-cli?tab=readme-ov-file#config). | ||
|
||
```js | ||
// postcss.config.mjs | ||
export default { | ||
plugins: [(await import("autoprefixer")).default], | ||
}; | ||
``` | ||
|
||
```js | ||
// postcss.config.js | ||
module.exports = { | ||
plugins: [require("autoprefixer")], | ||
plugins: [(await import("postcss-nested")).default], | ||
}; | ||
``` | ||
|
||
|
@@ -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]); | ||
|