Gatsby plugin to add support for styled components
npm install gatsby-plugin-styled-componentsA Gatsby plugin for
styled-components with
built-in server-side rendering support.
``shell`
npm install gatsby-plugin-styled-components styled-components babel-plugin-styled-components
Edit gatsby-config.js
`javascriptgatsby-plugin-styled-components
module.exports = {
plugins: [
{
resolve: ,`
options: {
// Add any options here
},
},
],
}
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:
`js`
options: {
displayName: false
}
Note: The ssr option will be ignored. Gatsby will apply it automatically when needed.
If you don't require vendor prefixes for adding legacy CSS properties then this can be disabled by supplying the disableVendorPrefixes option:
`js``
options: {
disableVendorPrefixes: true
}