6.1.1 • Published 2 months ago

gatsby-plugin-mini-css-class-name v6.1.1

Weekly downloads
244
License
MIT
Repository
github
Last release
2 months ago

gatsby-plugin-mini-css-class-name

test npm version

Minifying CSS class names if using CSS Modules.

- <p class="post-module--text--w-3Tg">Hello</p>
+ <p class="a">Hello</p>

Install

npm i gatsby-plugin-mini-css-class-name
#or
yarn add gatsby-plugin-mini-css-class-name

How to use

// In your gatsby-config.js
module.exports = {
  plugins: [`gatsby-plugin-mini-css-class-name`],
}

If you need to pass plugin options:

// In your gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-mini-css-class-name`,
      options: {
        prefix: `x-`,
      },
    },
  ],
}

⚠️ This plugin must be the last plugin witch work with CSS in your gatsby-config.js. This plugin contributes change to Webpack config and other plugins can delete the changes.

// In your gatsby-config.js
module.exports = {
  plugins: [
    `gatsby-plugin-postcss`,
    `gatsby-plugin-mini-css-class-name`, // after PostCSS
  ],
}

Options

NameTypeDefaultDescription
prefix{String}""A custom prefix will be added to each class name
suffix{String}""A custom suffix will be added to each class name
excludePattern{RegExp}nullA regular expression for removing characters

mini-css-class-name

License

MIT

6.1.1

2 months ago

6.1.0

6 months ago

6.0.0

1 year ago

5.0.0

1 year ago

4.5.0

2 years ago

4.4.0

2 years ago

4.3.0

3 years ago

4.2.1

3 years ago

4.2.0

3 years ago

4.1.0

3 years ago

4.0.0

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

4 years ago

2.2.0

4 years ago

2.1.0

4 years ago

2.0.0

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago