postcss-composes-enhanced

1.0.0 • Public • Published

PostCSS Composes Enhanced PostCSS

NPM Version Build Status Support Chat

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 = require('postcss-composes-enhanced')
 
composesEnhanced.process(YOUR_CSS /*, processOptions, pluginOptions */)

Or use it as a PostCSS plugin:

const postcss = require('postcss')
const composesEnhanced = require('postcss-composes-enhanced')
 
postcss([composesEnhanced(/* pluginOptions */)]).process(YOUR_CSS /*, processOptions */)

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.

Dependencies (1)

Dev Dependencies (9)

Package Sidebar

Install

npm i postcss-composes-enhanced

Weekly Downloads

25

Version

1.0.0

License

CC0-1.0

Unpacked Size

20.1 kB

Total Files

7

Last publish

Collaborators

  • romainmenke
  • alaguna
  • jonathantneal