JSPM

postcss-class-rename-8

0.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q18151F
  • License MIT

PostCSS plugin simply rename class without hassle

Package Exports

  • postcss-class-rename-8
  • postcss-class-rename-8/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (postcss-class-rename-8) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

postcss-class-rename

PostCSS plugin to replace class name by giving key-value mapping in options.


Installation

npm install postcss-class-rename --save-dev

Usage

rollup

postcss({
    plugins: [
      require('autoprefixer'),
      require('postcss-class-rename')({
        // replace 'button-' in class name to 'btn-'
        button-: 'btn-',
        // All options are treated as replacement mapping
        ...
      })
    ]
  }),

postcss.config.js

const rename = require('postcss-class-rename');

module.exports = ({ env }) => {
  plugins: [
    rename({
      // All options are treated as replacement mapping
      button-: 'btn-',
      ...
    })
  ]
}