My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members

Lessen is a lightweight CSS+LESS parser that's also capable of variable substitution and beautification of its output. It's consisted of a set of relatively independent "tokenizers" that you chain in a pipeline to transform the input to the output.

How to use:

  // Define variables
  Map<String, String> variables = new HashMap<String, String>();
  variables.put("module", "foo");
  variables.put("theme", "midnight");
  
  // Open a Less tokenizer
  Tokenizer tokenizer = Utilities.openLess(new File(filePath), variables);
  
  // Wrap it with more tokenizers to get the output you want
  tokenizer = new UrlRewritingTokenizer(tokenizer, "../modules/foo/styles/");
  tokenizer = new CondensingTokenizer(tokenizer);
  tokenizer = new IndentingTokenizer(tokenizer);
  
  // Print out the output
  Utilities.print(tokenizer, System.out);
Powered by Google Project Hosting