Boot task to compile Less.
- Provides the
less
task - For each
.main.less
in fileset creates equivalent.css
file. - Uses Less4j Java implementation of Less compiler
[s source-map bool "Create source-map for compiled CSS."
c compression bool "Compress compiled CSS using simple compression."]
To create css file public/css/main.css
have the less file on path public/css/main.main.less
or use sift task to move the css file:
(comp (less) (sift :move {#"main.css" "public/css/main.css"}))
- Load imports from classpath
- Loading order.
@import "{name}";
at{path}
.- check if file
{path}/{name}.less
exists - try
(io/resource "{name}.less")
- try
(io/resource "{path}/{name}.less")
- check if webjars asset map contains
{name}
- Resource
META-INF/resources/webjars/{package}/{version}/{path}
can be referred using{package}/{path}
- E.g.
bootstrap/less/bootstrap.less
=>META-INF/resources/webjars/bootstrap/3.3.1/less/bootstrap.less
- check if file
- You should be able to depend on
[org.webjars/bootstrap "3.3.1"]
and use@import "bootstrap/less/bootstrap";
- Use boot debug to find what is being loaded:
boot -vvv less
- Loading order.
If you are using some logging stuff it might be that library used by
less4j will write lots of stuff to your log, then you should add the following
rule to your logback.xml
:
<logger name="org.apache.commons.beanutils.converters" level="INFO"/>
Copyright © 2014-2015 Juho Teperi
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.