diff options
author | 2021-04-26 16:54:20 -0500 | |
---|---|---|
committer | 2021-04-26 15:54:20 -0600 | |
commit | dea1a6dfc9dec54034d2b872b4cd36c0174814c6 (patch) | |
tree | 49569a511201b4defc23b6654b475e458452596a /examples/snowpack/src/pages/guides/postcss.md | |
parent | 0ea4a986e207238bf0ac1db841b2a5d5b567d84d (diff) | |
download | astro-dea1a6dfc9dec54034d2b872b4cd36c0174814c6.tar.gz astro-dea1a6dfc9dec54034d2b872b4cd36c0174814c6.tar.zst astro-dea1a6dfc9dec54034d2b872b4cd36c0174814c6.zip |
Update defaults directory structure to `src` and `dist` (#132)
* chore: update defaults in docs
* chore: update config defaults
* test: update tests to config defaults
* chore: update gitignore to new defaults
* docs: update readme to new defaults
* chore: update examples to new defaults
* chore: update default exclude in lang server
* chore: update tests
* test: fix failing tests
* chore: update www defaults
Diffstat (limited to 'examples/snowpack/src/pages/guides/postcss.md')
-rw-r--r-- | examples/snowpack/src/pages/guides/postcss.md | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/examples/snowpack/src/pages/guides/postcss.md b/examples/snowpack/src/pages/guides/postcss.md new file mode 100644 index 000000000..3d8c26b84 --- /dev/null +++ b/examples/snowpack/src/pages/guides/postcss.md @@ -0,0 +1,34 @@ +--- +layout: ../../layouts/content.astro +title: 'PostCSS' +tags: communityGuide +published: true +img: '/img/logos/postcss.svg' +imgBackground: '#f8f8f2' +description: How to use PostCSS in your Snowpack project. +--- + +[PostCSS](https://postcss.org/) is a popular CSS transpiler with support for [a huge ecosystem of plugins.](https://github.com/postcss/postcss#plugins) + +**To use PostCSS with Snowpack:** add the [@snowpack/plugin-postcss](https://www.npmjs.com/package/@snowpack/plugin-postcss) plugin to your project. + +```diff +// snowpack.config.js +"plugins": [ ++ "@snowpack/plugin-postcss" +] +``` + +PostCSS requires a [`postcss.config.js`](https://github.com/postcss/postcss#usage) file in your project. By default, the plugin looks in the root directory of your project, but you can customize this yourself with the `config` option. See [the plugin README](https://www.npmjs.com/package/@snowpack/plugin-postcss) for all available options. + +```js +// postcss.config.js +// Example (empty) postcss config file +module.exports = { + plugins: [ + // ... + ], +}; +``` + +Be aware that this plugin will run on all CSS in your project, including any files that compiled to CSS (like `.scss` Sass files, for example). |