From Less website:
Less is a CSS pre-processor, meaning that it extends the CSS language, adding features that allow variables, mixins, functions and many other techniques that allow you to make CSS that is more maintainable, themable and extendable.
- cannot fetch sources from Internet, e.g.
@import (less) "http://example.org/style.less"
The compiler to run requires:
- Java 5.0 or higher
- Third-Party Dependencies (see list)
How to compile a source file:
// create compiler & source file LessCompiler compiler = new LessCompilerImpl(); File source = new File("/less/file.less"); // compile file with default options String cssCode = compiler.compile(source); // set custom option: minify CSS code CompilerOptions options = new CompilerOptionsBuilder().setMinified(true).create(); String cssMinifiedCode = compiler.compile(source, options);