Code Monkey home page Code Monkey logo

jlessc's Introduction

JLessC

Build Status License Coverage Status Download Maven

JLessC is a Less CSS compiler written completely in Java (pure Java). It does not need any additional libraries at runtime (no JavaScript, no ANTLR). The main target of the project is performance and compatibility to Bootstrap.

Required Java Version

JlessC requires Java SE 7 or higher. It is tested with Java SE 7 and 8 on travis-ci.org.

Add Dependency

Gradle users should add the library using the following dependency:

dependencies {
    compile 'de.inetsoftware:jlessc:+'
}

If you want to test a snapshot version with the latest bug fixes, then add the snapshot repository:

repositories {
    maven {
        url "https://oss.sonatype.org/content/repositories/snapshots/"
    }
    jcenter() // or any other repository that you use
}

Maven users should add the library using the following dependency:

<dependency>
  <groupId>de.inetsoftware</groupId>
  <artifactId>jlessc</artifactId>
  <version>RELEASE</version>
</dependency>

Usage

Check out the sources or download the binary and add it to your Java project. The following code sequence shows a sample usage:

import com.inet.lib.less.Less;
...

// Compile Less data to CSS output
String css = Less.compile( null, "@bgcol: red; #row { background-color: @bgcol; }", true );

API details can be found in the source of the Less class.

Benchmark

JLessC runs a benchmark test on the Travis build system using different less compilers. We always use the latest version of every compiler. We measure the compile time of the Bootstrap sample in our test suite. The table shows a result for Java SE 8. Of course the values can change over the time.

Tool Time
JLessC ~400 ms
less.js via Exec call to nodeJS ~850 ms
Official LESS CSS Compiler for Java ~4400 ms
LESS Engine ~10800 ms

Alternative libraries

Reference usage

We use JLessC in our reporting software i-net Clear Reports and PDF file comparer i-net PDFC for user customized themes.

jlessc's People

Contributors

horcrux7 avatar gamma avatar bennybao avatar epaga avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.