$ npm install gatsby-plugin-styled-components
A Gatsby plugin for styled-components with built-in server-side rendering support.
npm install gatsby-plugin-styled-components styled-components babel-plugin-styled-components
Edit gatsby-config.js
module.exports = {
plugins: [
{
resolve: `gatsby-plugin-styled-components`,
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:
options: {
displayName: false
}
Note: The ssr
option will be ignored. Gatsby will apply it automatically when needed.
support Gatsby v2 only
styled-components
is moved to a peer dependency. Installing the package
alongside gatsby-plugin-styled-components
is now required. Use npm install styled-components
© 2010 - cnpmjs.org x YWFE | Home | YWFE