PostCSS Composes Enhanced
PostCSS Composes Enhanced lets you enhance the composes behavior in CSS Modules.
.example { @composes no-margin from '@company/layout';} /* becomes */ .example { composes: no-margin from '../../node_modules/@company/layout/index.module.css';}
Usage
Add PostCSS Composes Enhanced to your project:
npm install postcss-composes-enhanced --save-dev
Use PostCSS Composes Enhanced to process your CSS:
const composesEnhanced = composesEnhanced
Or use it as a PostCSS plugin:
const postcss = const composesEnhanced =
PostCSS Composes Enhanced runs in all Node environments, with special instructions for:
Node | PostCSS CLI | Webpack | Create React App | Gulp | Grunt |
---|
Options
resolveImports
The resolveImports
option determines whether imports within composes
declarations should be resolved.
transformAtRules
The transformAtRules
option determines whether @composes
at-rules should be transformed into declarations.
Additional Options
Additional options will be passed through into css-import-resolve
.