rollup-plugin-stylus-plus
v2.0.0-beta.1
Published
A Rollup.js plugin to compile and load Stylus, support CSS Modules
Downloads
2
Maintainers
Readme
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.
- If you specify a
sourcemap
: Iftrue
is specified, source map to be embedded in the output CSS (default istrue
).plugins
: Afunction
invoked with the Stylus renderer (it will be passed touse()
function of the Stylus).
License
MIT