Official LESS CSS Compiler for Java


License

License

GroupId

GroupId

org.lesscss
ArtifactId

ArtifactId

lesscss
Last Version

Last Version

1.7.0.1.1
Release Date

Release Date

Type

Type

jar
Description

Description

Official LESS CSS Compiler for Java
Official LESS CSS Compiler for Java
Project URL

Project URL

http://github.com/marceloverdijk/lesscss-java
Source Code Management

Source Code Management

http://github.com/marceloverdijk/lesscss-java

Download lesscss

How to add to project

<!-- https://jarcasting.com/artifacts/org.lesscss/lesscss/ -->
<dependency>
    <groupId>org.lesscss</groupId>
    <artifactId>lesscss</artifactId>
    <version>1.7.0.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.lesscss/lesscss/
implementation 'org.lesscss:lesscss:1.7.0.1.1'
// https://jarcasting.com/artifacts/org.lesscss/lesscss/
implementation ("org.lesscss:lesscss:1.7.0.1.1")
'org.lesscss:lesscss:jar:1.7.0.1.1'
<dependency org="org.lesscss" name="lesscss" rev="1.7.0.1.1">
  <artifact name="lesscss" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.lesscss', module='lesscss', version='1.7.0.1.1')
)
libraryDependencies += "org.lesscss" % "lesscss" % "1.7.0.1.1"
[org.lesscss/lesscss "1.7.0.1.1"]

Dependencies

compile (2)

Group / Artifact Type Version
org.mozilla : rhino jar 1.7R4
org.slf4j : slf4j-api Optional jar 1.7.2

runtime (1)

Group / Artifact Type Version
org.slf4j : slf4j-simple jar 1.7.2

test (6)

Group / Artifact Type Version
junit : junit jar 4.10
org.apache.commons : commons-lang3 jar 3.1
org.mockito : mockito-core jar 1.9.0
org.powermock : powermock-module-junit4 jar 1.4.11
org.powermock : powermock-api-mockito jar 1.4.11
org.jodah : concurrentunit jar 0.3.0

Project Modules

There are no modules declared in this project.

Official LESS CSS Compiler for Java

Latest release 1.7.0.1.1 - The 1.1 release that is compatible with less 1.7.0

LESS CSS Compiler for Java is a library to compile LESS sources to CSS stylesheets.

The compiler uses Rhino, Envjs (simulated browser environment written in JavaScript), and the official LESS JavaScript compiler.

Look at the simple example below to compile LESS to CSS:

// Instantiate the LESS compiler
LessCompiler lessCompiler = new LessCompiler();

// Instantiate the LESS compiler with some compiler options
LessCompiler lessCompiler = new LessCompiler(Arrays.asList("--relative-urls", "--strict-math=on"));

// Compile LESS input string to CSS output string
String css = lessCompiler.compile("@color: #4D926F; #header { color: @color; }");

// Or compile LESS input file to CSS output file
lessCompiler.compile(new File("main.less"), new File("main.css"));

LessCompiler is thread safe. In other words, an application only needs one LessCompiler that it can reuse whenever necessary.

To learn more about LESS, please see http://lesscss.org/.

Getting Started

Maven users should add the library using the following dependency:

<dependency>
  <groupId>org.lesscss</groupId>
  <artifactId>lesscss</artifactId>
  <version>1.7.0.1.1</version>
</dependency>

(lesscss-java is in the Maven Central repository.)

Non-Maven users should download the latest version and add it to the project's classpath. Also the following dependencies are required:

If SLF4J is present in the classpath, it will be used for logging.

Compatibility

The LESS CSS Compiler for Java contains all LESS compatibility tests. All tests pass, except the @import test case which fails partially as the compiler does not support the media query import feature (yet).

The project also contains integration tests for compiling the Twitter Bootstrap (http://twitter.github.com/bootstrap/) library. If you are using another 3th party LESS library you want to be added to the integration tests, just create a issue and provide a link to the library.

Support

Have a question, or found an issue? Just create a issue: https://github.com/marceloverdijk/lesscss-java/issues

Building From Source

Can be built with Maven 2.2.x (or later?) by using the following commands:

mvn package

or, to install into your local Maven repository:

mvn install

You may also wish to build API Documentation:

mvn javadoc:javadoc

Authors

Marcel Overdijk

Craig Andrews

Christophe Popov

Copyright and License

Copyright 2012 Marcel Overdijk

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Versions

Version
1.7.0.1.1
1.7.0.1.0
1.3.3
1.3.1
1.3.0