The PostCSS plugin, for Next.js & anything else with PostCSS in its pipeline. It works through Turbopack & Webpack alike, since both go through the same built-in PostCSS support.
Usage
- 1
Install the Plugin
pnpm add -D @yummacss/postcss - 2
Register It
Add the plugin to your PostCSS configuration. It works through Turbopack & Webpack alike.
postcss.config.mjsexport default { plugins: { "@yummacss/postcss": {}, },}; - 3
Add the Marker
Put
@yummacss;in your global CSS file. The plugin replaces it with the generated CSS.globals.css@yummacss;Installation walks through the whole setup, including the config file.
Options
| Option | Type | Default | Description |
|---|---|---|---|
config | Config | Inline configuration. When provided, no config file is read. | |
configPath | string | yumma.config.mjs | Path to the config file. |
cwd | string | process.cwd() | Directory to resolve the config file & source globs from. |
cwd is the one option the Vite plugin does not have. PostCSS is often run from a directory other than the project root, and the source globs are relative to the config file rather than to wherever the process started:
postcss.config.mjs
export default {
plugins: {
"@yummacss/postcss": { cwd: import.meta.dirname },
},
};