Switch branches/tags
Find file History
KyleAMathews chore(release): Publish
 - babel-plugin-remove-graphql-queries@2.5.0
 - cypress-gatsby@0.1.1
 - gatsby-cli@2.4.0
 - gatsby-codemods@1.0.2
 - gatsby-dev-cli@2.4.0
 - gatsby-image@2.0.5
 - gatsby-link@2.0.1
 - gatsby-plugin-canonical-urls@2.0.5
 - gatsby-plugin-catch-links@2.0.2
 - gatsby-plugin-coffeescript@2.0.5
 - gatsby-plugin-create-client-paths@2.0.0
 - gatsby-plugin-emotion@2.0.5
 - gatsby-plugin-facebook-analytics@2.0.0
 - gatsby-plugin-feed@2.0.5
 - gatsby-plugin-flow@1.0.1
 - gatsby-plugin-fullstory@2.0.0
 - gatsby-plugin-glamor@2.0.5
 - gatsby-plugin-google-analytics@2.0.5
 - gatsby-plugin-google-tagmanager@2.0.5
 - gatsby-plugin-guess-js@1.0.0
 - gatsby-plugin-jss@2.0.2
 - gatsby-plugin-layout@1.0.0
 - gatsby-plugin-less@2.0.5
 - gatsby-plugin-lodash@3.0.1
 - gatsby-plugin-manifest@2.0.2
 - gatsby-plugin-netlify-cms@3.0.0
 - gatsby-plugin-netlify@2.0.0
 - gatsby-plugin-no-sourcemaps@2.0.0
 - gatsby-plugin-nprogress@2.0.5
 - gatsby-plugin-offline@2.0.5
 - gatsby-plugin-page-creator@2.0.0
 - gatsby-plugin-postcss@2.0.0
 - gatsby-plugin-preact@2.0.5
 - gatsby-plugin-react-css-modules@2.0.0
 - gatsby-plugin-react-helmet@3.0.0
 - gatsby-plugin-remove-trailing-slashes@2.0.0
 - gatsby-plugin-sass@2.0.1
 - gatsby-plugin-sharp@2.0.5
 - gatsby-plugin-sitemap@2.0.1
 - gatsby-plugin-styled-components@3.0.0
 - gatsby-plugin-styled-jsx@3.0.1
 - gatsby-plugin-styletron@3.0.0
 - gatsby-plugin-stylus@2.0.1
 - gatsby-plugin-subfont@1.0.1
 - gatsby-plugin-twitter@2.0.5
 - gatsby-plugin-typescript@2.0.0
 - gatsby-plugin-typography@2.2.0
 - gatsby-react-router-scroll@2.0.0
 - gatsby-remark-autolink-headers@2.0.5
 - gatsby-remark-code-repls@2.0.0
 - gatsby-remark-copy-linked-files@2.0.5
 - gatsby-remark-custom-blocks@2.0.0
 - gatsby-remark-embed-snippet@3.0.0
 - gatsby-remark-graphviz@1.0.0
 - gatsby-remark-images-contentful@2.0.0
 - gatsby-remark-images@2.0.1
 - gatsby-remark-katex@2.0.5
 - gatsby-remark-prismjs@3.0.0
 - gatsby-remark-responsive-iframe@2.0.5
 - gatsby-remark-smartypants@2.0.5
 - gatsby-source-contentful@2.0.1
 - gatsby-source-drupal@2.2.0
 - gatsby-source-faker@2.0.0
 - gatsby-source-filesystem@2.0.1
 - gatsby-source-graphql@2.0.0
 - gatsby-source-hacker-news@2.0.5
 - gatsby-source-lever@2.0.0
 - gatsby-source-medium@2.0.0
 - gatsby-source-mongodb@2.0.5
 - gatsby-source-npm-package-search@2.0.0
 - gatsby-source-wikipedia@2.0.0
 - gatsby-source-wordpress@3.0.0
 - gatsby-transformer-csv@2.0.0
 - gatsby-transformer-documentationjs@2.0.0
 - gatsby-transformer-excel@2.1.1
 - gatsby-transformer-hjson@2.1.1
 - gatsby-transformer-javascript-frontmatter@2.0.0
 - gatsby-transformer-javascript-static-exports@2.1.1
 - gatsby-transformer-json@2.1.1
 - gatsby-transformer-react-docgen@2.1.1
 - gatsby-transformer-remark@2.1.1
 - gatsby-transformer-screenshot@2.0.0
 - gatsby-transformer-sharp@2.1.1
 - gatsby-transformer-sqip@2.0.0
 - gatsby-transformer-toml@2.1.1
 - gatsby-transformer-xml@2.0.0
 - gatsby-transformer-yaml@2.1.1
 - gatsby@2.0.0
 - graphql-skip-limit@2.0.0
Latest commit dc95450 Sep 17, 2018

README.md

gatsby-plugin-postcss

Gatsby plugin to handle PostCSS.

Install

npm install --save gatsby-plugin-postcss

How to use

  1. Include the plugin in your gatsby-config.js file.
  2. Write your stylesheets using PostCSS (.css files) and require or import them as normal.
// in gatsby-config.js
plugins: [`gatsby-plugin-postcss`],

If you need to pass options to PostCSS use the plugins options; see postcss-loader for all available options.

With CSS Modules

Using CSS modules requires no additional configuration. Simply prepend .module to the extension. For example: App.css -> App.module.css. Any file with the module extension will use CSS modules.

PostCSS plugins

If you would prefer to add additional postprocessing to your PostCSS output you can specify plugins in the plugin options:

// in gatsby-config.js
plugins: [
  {
    resolve: `gatsby-plugin-postcss`,
    options: {
      postCssPlugins: [require(`postcss-preset-env`)({ stage: 0 })],
    },
  },
],

Alternatively, you can use postcss.config.js to specify your particular PostCSS configuration:

// in postcss.config.js
const postcssPresetEnv = require(`postcss-preset-env`)

module.exports = () => ({
  plugins: [
    postcssPresetEnv({
      stage: 0,
    }),
  ],
})