Giter Site home page Giter Site logo

priyabhatt13 / gatsby-plugin-module-local-ident-name Goto Github PK

View Code? Open in Web Editor NEW

This project forked from m-allanson/gatsby-plugin-module-local-ident-name

0.0 2.0 0.0 6 KB

Adds support for specifying CSS Modules classnames in Gatsby's development mode

JavaScript 100.00%

gatsby-plugin-module-local-ident-name's Introduction

gatsby-plugin-module-local-ident-name

Adds support for specifying CSS Modules classnames in Gatsby's development mode. No changes are made to Gatsby's production builds.

Install

yarn add gatsby-plugin-module-local-ident-name

How to use

  1. Include the plugin in your gatsby-config.js file.
  2. Specify a new localIdentName for your class names
  3. Want to include SASS files? Set includeSASS to true
// in gatsby-config.js
plugins: [
  {
    resolve: `gatsby-plugin-module-local-ident-name`,
    options: {
      localIdentName: "[folder]-[local]-[hash:base64:5]",
      includeSASS: true //default false
    }
  }
]

See the loader-utils docs for a list of valid tokens that can be used in localIdentName.

Here's an example of HTML output using Gatsby's default CSS Modules config:

default classes

The same HTML after enabling the plugin with the above config:

modified classes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.