
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
gatsby-plugin-astroturf
Advanced tools
This plugin modifies Gatsby's webpack configuration to support astroturf.
Install the plugin and astroturf:
yarn add gatsby-plugin-astroturf astroturf
Add it to your plugins in gatsby-config.js:
plugins: [
'gatsby-plugin-astroturf',
]
You can also pass options to astroturf's webpack loader:
plugins: [
{
resolve: 'gatsby-plugin-astroturf',
// defaults:
options: {
tagName: 'css',
styledTag: 'styled',
extension: '.module.css',
},
},
]
For astroturf to work properly you need to add nesting support. For that you can use postcss-nested or another plugin which contains this feature, like precss. You can install these plugins and many more using gatsby-plugin-postcss:
yarn add gatsby-plugin-postcss
plugins: [
'gatsby-plugin-postcss',
'gatsby-plugin-astroturf',
]
You can specify PostCSS plugins through gatsby-plugin-postcss's postCssPlugins option, or by creating a postcss.config.js file:
yarn add postcss-nested
// postcss.config.js
module.exports = {
plugins: {
'postcss-nested': {},
}
}
If you'd like to use Sass, Less or some other preprocessor instead of (or in addition to) PostCSS, make sure that you adjust the extension option and install the appropriate Gatsby plugin. For example, this is all you need to add support for Sass:
yarn add gatsby-plugin-sass
plugins: [
'gatsby-plugin-sass',
{
resolve: 'gatsby-plugin-astroturf',
options: {
extension: '.module.scss',
},
},
]
Just make sure that your Gatsby plugin supports CSS Modules. Also, note that Sass already has support for nesting, so you don't need postcss-nested.
Happy styling! :art:
FAQs
Gatsby plugin for styling with astroturf
The npm package gatsby-plugin-astroturf receives a total of 124 weekly downloads. As such, gatsby-plugin-astroturf popularity was classified as not popular.
We found that gatsby-plugin-astroturf demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.