https://github.com/9technology/css-modules-stylus
Stylus preprocessor for css-modules-require-hook.
https://github.com/9technology/css-modules-stylus
css-modules stylus
Last synced: about 2 months ago
JSON representation
Stylus preprocessor for css-modules-require-hook.
- Host: GitHub
- URL: https://github.com/9technology/css-modules-stylus
- Owner: 9technology
- License: bsd-3-clause
- Created: 2017-02-21T06:03:11.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-08T04:08:27.000Z (almost 8 years ago)
- Last Synced: 2025-03-06T04:36:51.433Z (about 2 months ago)
- Topics: css-modules, stylus
- Language: JavaScript
- Size: 62.5 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# css-modules-stylus
[](https://travis-ci.org/9technology/css-modules-stylus) [](https://coveralls.io/github/9technology/css-modules-stylus?branch=master)
Stylus preprocessor for CSS Modules required via [css-modules-require-hook](https://github.com/css-modules/css-modules-require-hook) or [babel-plugin-css-modules-transform](https://github.com/michalkvasnicak/babel-plugin-css-modules-transform).
## Usage
---```js
import hook from 'css-modules-require-hook';
import stylus from 'css-modules-stylus';hook({
preprocessCss: stylus
});
```### Stylus Options
Passing options to stylus can be done by creating a default stylus instance using `.defaults()`.
```js
import { defaults as stylus } from 'css-modules-stylus';hook({
preprocessCss: stylus({
use: [ plugin() ]
})
});
```### Babel Plugin
_.babelrc_
```json
{
"plugins": [
["css-modules-transform", {
"preprocessCss": "css-modules-stylus"
}]
]
}
```## API
---#### `cssModulesStylus(contents, filename)`
- `contents` _String_ The contents of the stylus file.
- `filename` _String_ The filename of the stylus file.#### `.defaults([options])`
- `options` _Object_ Stylus [Renderer options](https://github.com/stylus/stylus/blob/0.54.5/lib/renderer.js#L36-L44).## License
---[BSD-3-Clause](LICENSE)
Copyright (c) 2017 [9Technology](https://github.com/9technology)