The stylus-precompiler allows you to author your stylesheets with the CSS superset of
Stylus. It supports variables, mixins, and lots of other really useful stuff. The .styl
and .stylus
files will get compiled and _attached to your
couchapp on every build and can even be compressed.
Add stylus-precompiler
to your dependencies section in kanso.json
.
...
"dependencies": {
"stylus-precompiler": null,
...
}
run
kanso install
to fetch the package
To tell the precompiler which files to transform, add the section stylus
,
and in a key called compile
, list the files you want to process.
...
"stylus": {
"compile": [ "css/style.styl", ... ]
}
...
"dependencies": {
"stylus-precompiler": null,
...
}
Running
kanso push
will compile the filecss/style.styl
tocss/style.css
and upload it to_attachments/css/style.css
.
To enable compression of the output, add the compress
flag and set it to true
.
...
"stylus": {
"compile": [ ... ],
"compress": true
}
You can also remove any .styl files from attachments (if you placed them inside a
directory also added as static files), by adding the remove_from_attachments
property. This will remove all attachment with .styl
and .stylus
extensions!
...
"stylus": {
"compile": [ ... ],
"remove_from_attachments": true
}