The less-precompiler allows you to author your stylesheets with the CSS superset of
LESS. It supports @variables
, .mixins()
and lots of
other really useful stuff. The less files will get compiled and _attached to your
couchapp on every build and can even be compressed.
Add less-precompiler
to your dependencies section in kanso.json
.
...
"dependencies": {
"less-precompiler": null,
...
}
run
kanso install
to fetch the package
To tell the precompiler which files to transform, add the section less
,
and in a key called compile
, list the files you want to process.
...
"less": {
"compile": [ "css/style.less", ... ]
}
...
"dependencies": {
"less-precompiler": null,
...
}
Running
kanso push
will compile the filecss/style.less
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
.
...
"less": {
"compile": [ ... ],
"compress": true
}
Less files can include other less templates, sometimes it's useful for a
package to provide uncompiled .less files for use in a project. Before you
can include them in the project's templates, the package providing the
files needs to add the less path. This is so the compiler knows where to
lookup the file when you @include
it.
...
"less": {
"paths": ["./bootstrap"]
}
You can also remove any .less 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 a .less
extension!
...
"less": {
"compile": [ ... ],
"remove_from_attachments": true
}