rollup-plugin-stylus-plus

2.0.0-beta.1 • Public • Published

rollup-plugin-stylus-plus

A Rollup.js plugin to compile and load Stylus with CSS Modules. Powered by rollup-plugin-stylus-css-modules!

Installation

npm install --save-dev rollup-plugin-stylus-plus

Usage

Add the following code to your project's rollup.config.js:

import stylus from 'rollup-plugin-stylus-plus';
 
export default {
  input: 'index.js',
  plugins: [
    stylus({
      output: 'styles.css'
    }),
  ]
};

in Stylus

.container
  height 100%

in JS

import styles from './styles.styl';
 
const container = `<div class="${styles.container}">...</div>`;

Options

  • include, exclude: A minimatch pattern, or an array of minimatch patterns of including ID, or excluding ID (optional).
  • output: Output destination (optional).
    • If you specify a string, it will be the path to write the generated CSS.
    • If you specify a function, call it passing the generated CSS as an argument.
  • sourcemap: If true is specified, source map to be embedded in the output CSS (default is true).
  • plugins: A function invoked with the Stylus renderer (it will be passed to use() function of the Stylus).

License

MIT

Package Sidebar

Install

npm i rollup-plugin-stylus-plus

Weekly Downloads

0

Version

2.0.0-beta.1

License

MIT

Last publish

Collaborators

  • blackcater