sass-class-prefix

Parse sass file and add any prefix to scss(sass)'s class selector

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
sass-class-prefix
220.0.48 years ago8 years agoMinified + gzip package size for sass-class-prefix in KB

Readme

sass-class-prefix
Build Status Parse sass file and add any prefix to scss(sass)'s class selector.
Install
Install with npm
npm install --save-dev sass-class-prefix
Usage
const prefixer = require('sass-class-prefix');
const target = `
  .hello {
    .world {
      color: red;
    }
  }
`;
const parsed = prefixer.parse(target, 'prefix-');
console.log(parsed);
// =>
// .prefix-hello {
//  .prefix-world {
//    color: red;
//  }
// }
API
  • parse(scssText: string, prefix: string)
  • parseFile(filePath: string, prefix: string)
ToDo
  • implements cli
  • gulp integration
  • webpack loader integration