Create Blazing Fast Websites with Gatsby and Drupal
    • Training Introduction
    • Gatsby Overview
      • Gatsby Intro
      • What is React?
      • What is GraphQL
      • Babel & Webpack
    • Modern JS Overview
      • JS Map Function
      • Let and Const
      • Template Strings (Interpolated Literals)
      • Arrow Functions
      • Destructuring
      • Async... Await
    • Installing Gatsby
    • Gatsby Building Blocks
      • Gatsby Starters
      • Plugins & Themes
      • Gatsby Pages
      • About Page Solution
      • Building with Components
      • Gatsby Link Component
    • Styles in Gatsby
      • CSS and SASS
      • CSS Modules
      • CSS in JS
      • Emotion
    • Nested Layout Components
      • Layout Solution
    • Data in Gatsby
      • GraphQL in Gatsby
      • Query Types
      • Gatsby Source Drupal
      • Create Lists of Content
      • Gatsby Image Component
    • Portfolio Challenge
    • Deploying to Netlify
    • Bonus Lessons
      • Gatsby Contact Form
      • Pagination
      • Live Preview
      • Build Hooks
      • Dynamic Content
      • Algolia Search
    • Thank You

  • Gatsby Docs
  • Code Karate

  • Star
    • Training Introduction
    • Gatsby Overview
      • Gatsby Intro
      • What is React?
      • What is GraphQL
      • Babel & Webpack
    • Modern JS Overview
      • JS Map Function
      • Let and Const
      • Template Strings (Interpolated Literals)
      • Arrow Functions
      • Destructuring
      • Async... Await
    • Installing Gatsby
    • Gatsby Building Blocks
      • Gatsby Starters
      • Plugins & Themes
      • Gatsby Pages
      • About Page Solution
      • Building with Components
      • Gatsby Link Component
    • Styles in Gatsby
      • CSS and SASS
      • CSS Modules
      • CSS in JS
      • Emotion
    • Nested Layout Components
      • Layout Solution
    • Data in Gatsby
      • GraphQL in Gatsby
      • Query Types
      • Gatsby Source Drupal
      • Create Lists of Content
      • Gatsby Image Component
    • Portfolio Challenge
    • Deploying to Netlify
    • Bonus Lessons
      • Gatsby Contact Form
      • Pagination
      • Live Preview
      • Build Hooks
      • Dynamic Content
      • Algolia Search
    • Thank You

  • Gatsby Docs
  • Code Karate

CSS Modules

Github logo Edit on GitHub

A CSS Module is a CSS file in which all class names and animation names are scoped locally by default.

By using CSS Modules you can have more specific control over your components. If you have ever felt yourself using really long classnames (or BEM syntax), you have an idea of why this might be useful.

I have not personally used CSS Modules much besides going through the Gatsby examples. If this approach interests you, I encourage you to check out the CSS Modules Gatsby documentation and the CSS Modules Github Page

Previous
CSS and SASS
Next
CSS in JS