postcss-filename-prefix
A PostCSS plugin to prefix classes with corresponding filenames
The idea is to isolate styles in framework components
MyComponent.css
Output:
Ignores:
- filenames that starts from not capital letter
- modifiers (classes that starts from hyphen)
- classes that starts from capital letter
Installation
npm install postcss-filename-prefix
Usage
var fs = ;var postcss = ;var filenamePrefix = ; var css = fs;var out = ;
ignore
option
Using the var fs = ;var postcss = ;var filenamePrefix = ; var css = fs;var out = ;
License
MIT
Recommendation
- Use it with react-prefix-loader for React components
Acknowledgements
- Inspired by postcss-class-prefix