Real World Performance: lazy loading, optimizing media, faster analytics join us Wednesday

ContactSign Up
Community Plugin
View plugin on GitHub


A Gatsby plugin that provides typings for css modules.

The reason this plugin is created is because the ones that are already out there, have multiple problems, for example not working with newer versions of Gatsby, or transforming ALL css files regardless of if they’re modules or not.

Based on


npm i gatsby-plugin-css-modules-typings

Then add the plugin to your gatsby-config.js file:

plugins: [
  // ...

Now you can import styles normally in TypeScript:

import * as styles from "./my.module.css"

:warning: This plugin only creates typings for CSS Modules, meaning files which names are ending with .module.css.


MIT License

© 2023 Gatsby, Inc.