Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bokysan/jlesscss

Less CSS compiler for Java, based on official lesscss.js
https://github.com/bokysan/jlesscss

css-compiler java javascript less less-compiler less-css servlet

Last synced: about 10 hours ago
JSON representation

Less CSS compiler for Java, based on official lesscss.js

Awesome Lists containing this project

README

        

jlesscss
========

Less CSS compiler for Java, based on official lesscss.js

Heavily inspired by:
* http://mojo.codehaus.org/lesscss-maven-plugin/
* https://github.com/ultraq/lesscss-filter
* https://github.com/marceloverdijk/lesscss-java

Why did I do it? Simply because most Java compilers rely on the outdated version of Less and it's difficult
to keep up with the latest less developments.

This method allows you to use the latest version of less by simply dropping the `less-rhino.js` file into the
appropriate directory.

What's wrong with the [official LESS compiler](https://github.com/marceloverdijk/lesscss-java)? Well, two things:
* it reads files from disk and does not use HTTP servlet API (hence, your *.less files must be static files and
cannot be dynamically generated)
* always creates temporary files when compiling
* support for different scripting engines through `javax.scripting`: https://github.com/pose/jav8 and nashorn

Usage of the filter
===================

To use the servlet, simply drop the JAR into your webapp. The Servlet 3.0 should pick up the filter and
attach it to *.less automatically.

Then you only need to to:
```html


```

Using the maven plugin
======================

As the compilation can take some time (yes, Rhino is slow), there's also an option to use a precompiled version.
For this, please use the maven plugin found here: https://github.com/marceloverdijk/lesscss-maven-plugin

Example usage:

```xml

org.lesscss
lesscss-maven-plugin

${project.basedir}/src/main/webapp/_common/css
${project.build.directory}/${project.build.finalName}/_common/css
true

common.less





compile




```

Requirements
============

* Java 7
* A Servlet 3.0 compliant servlet container