Branch: master
Find file History
DSchau chore(release): Publish
 - gatsby-dev-cli@2.4.10
 - gatsby-plugin-cxs@2.0.6
 - gatsby-plugin-jss@2.0.8
 - gatsby-plugin-styled-components@3.0.6
 - gatsby@2.1.9
Latest commit f9898b2 Feb 20, 2019

README.md

gatsby-plugin-styled-components

A Gatsby plugin for styled-components with built-in server-side rendering support.

Install

npm install --save gatsby-plugin-styled-components styled-components babel-plugin-styled-components

How to use

Edit gatsby-config.js

module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-styled-components`,
      options: {
        // Add any options here
      },
    },
  ],
}

Options

You can pass options to the plugin, see the Styled Components docs for a full list of options.

For example, to disable the displayName option:

options: {
  displayName: false
}

Note: The ssr option will be ignored. Gatsby will apply it automatically when needed.

Breaking changes history

v3.0.0

support Gatsby v2 only

v2.0.1

styled-components is moved to a peer dependency. Installing the package alongside gatsby-plugin-styled-components is now required. Use npm install --save styled-components