Skip to content

Commit

Permalink
update PostCSS plugin docs for ESM only configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 committed Dec 13, 2024
1 parent f4a6db1 commit 44f75d5
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/pages/docs/plugins/postcss.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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],
};
```

Expand All @@ -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]);
Expand All @@ -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]);
Expand Down

0 comments on commit 44f75d5

Please sign in to comment.