{"id":15011542,"url":"https://github.com/gabrysbiz/lesscss-compiler","last_synced_at":"2026-01-10T14:01:32.714Z","repository":{"id":27339603,"uuid":"30814462","full_name":"gabrysbiz/lesscss-compiler","owner":"gabrysbiz","description":"A Java library which compiles Less source files to the CSS code.","archived":true,"fork":false,"pushed_at":"2018-12-26T12:11:01.000Z","size":16434,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-29T18:04:49.902Z","etag":null,"topics":["compiler","java-library","less","lesscss"],"latest_commit_sha":null,"homepage":"http://lesscss-compiler.projects.gabrys.biz/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gabrysbiz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-15T01:32:23.000Z","updated_at":"2023-01-28T10:07:18.000Z","dependencies_parsed_at":"2022-08-07T12:16:14.444Z","dependency_job_id":null,"html_url":"https://github.com/gabrysbiz/lesscss-compiler","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrysbiz%2Flesscss-compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrysbiz%2Flesscss-compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrysbiz%2Flesscss-compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrysbiz%2Flesscss-compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gabrysbiz","download_url":"https://codeload.github.com/gabrysbiz/lesscss-compiler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235184570,"owners_count":18949267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compiler","java-library","less","lesscss"],"created_at":"2024-09-24T19:41:13.696Z","updated_at":"2025-10-03T20:32:14.455Z","avatar_url":"https://github.com/gabrysbiz.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About\n[![License BSD 3-Clause](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg)](http://lesscss-compiler.projects.gabrys.biz/license.txt)\n[![Build Status](https://travis-ci.org/gabrysbiz/lesscss-compiler.svg?branch=master)](https://travis-ci.org/gabrysbiz/lesscss-compiler)\n\nThe LessCSS Compiler is a Java library which compiles [Less](http://lesscss.org/) source files to [CSS](http://www.w3.org/Style/CSS/) code.\n\nFrom [Less](http://lesscss.org/) website:\n\u003e Less is a CSS pre-processor, meaning that it extends the CSS language, adding features that allow variables,\n\u003e mixins, functions and many other techniques that allow you to make CSS that is more maintainable, themable\n\u003e and extendable.\n\n# Compatibility\nThe compiler is compatible with version [1.7.5](https://github.com/less/less.js/releases/tag/v1.7.5).\nThe library is based on the official [Less](http://lesscss.org/) JavaScript compiler adapted to the\n[Rhino](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino) engine.\n\nIt supports sources located at:\n* local drives\n* protocols: \n  * [HTTP](https://www.w3.org/Protocols/) and HTTPS\n  * [FTP](https://www.w3.org/Protocols/rfc959/) (requires [Apache Commons Net](https://commons.apache.org/proper/commons-net/) library in the class path)\n  * class path (prefix `classpath://`)\n* custom - defined by programmers (see [FileSystem](http://lesscss-compiler.projects.gabrys.biz/2.0.1/apidocs/index.html?biz/gabrys/lesscss/compiler2/filesystem/FileSystem.html))\n\n# Requirements\nThe compiler to run requires:\n* Java 8 or higher\n* Third-Party Dependencies ([see list](http://lesscss-compiler.projects.gabrys.biz/2.0.1/dependencies.html))\n\n# Download\nYou can download the library from [this page](http://lesscss-compiler.projects.gabrys.biz/2.0.1/download.html)\nor using various [dependency management tools](http://lesscss-compiler.projects.gabrys.biz/2.0.1/dependency-info.html).\n\n# Concept\nThe library contains two compilers:\n* [NativeLessCompiler](http://lesscss-compiler.projects.gabrys.biz/2.0.1/apidocs/index.html?biz/gabrys/lesscss/compiler2/NativeLessCompiler.html) is a compiler with a shell-type API\n* [LessCompiler](http://lesscss-compiler.projects.gabrys.biz/2.0.1/apidocs/index.html?biz/gabrys/lesscss/compiler2/LessCompiler.html) is a facade for the `NativeLessCompiler` with a developer-friendly API\n\nThe idea for the `NativeLessCompiler` class was based on the [lesscss-java](https://github.com/marceloverdijk/lesscss-java)\nlibrary by [Marcel Overdijk](https://github.com/marceloverdijk).\n\n# Usage\nThe `LessCompiler` contains 32 methods. Below is an example of how to use some of them:\n```java\nString cssCode = null;\nLessOptions options = null;\n\n// create compiler\nLessCompiler compiler = new LessCompiler();\n\n// compile source code\ncssCode = compiler.compileCode(\".basic { display: block; }\");\n\n// compile source code with custom options\noptions = new LessOptionsBuilder().ieCompatibilityOff().build();\ncssCode = compiler.compileCode(\".basic { display: block; }\", options);\n\n// compile source file specified by path\ncssCode = compiler.compile(\"http://www.example.org/style.less\");\n\n// compile source file\ncssCode = compiler.compile(new File(\"source.less\"));\n\n// compile source file specified by path and save CSS code in an output file\ncompiler.compile(\"http://www.example.org/style.less\", new File(\"output.css\"));\n\n// compile source file and save CSS code in an output file\ncompiler.compile(new File(\"source.less\"), new File(\"output.css\"));\n\n// compile source file and compress CSS code\ncssCode = compiler.compileAndCompress(new File(\"source.less\"));\n\n// compile source file specified by path and compress CSS code using custom encoding\ncssCode = compiler.compileAndCompress(\"http://www.example.org/style.less\", Charset.forName(\"UTF-8\"));\n\n// compile source code and generate inline source map\ncssCode = compiler.compileCodeWithInlineSourceMap(\".basic { display: block; }\", new LessOptions());\n\n// compile source file and generate source map (save it in output.map file)\noptions = new LessOptionsBuilder().sourceMapBasePath(\"basePath\").build();\ncompiler.compileWithSourceMap(new File(\"source.less\"), new File(\"output.css\"), new File(\"output.map\"), options);\n\n// compile source file specified by path and generate source map (save it in output.css.map file)\ncompiler.compileWithSourceMap(\"http://www.example.org/style.less\", new File(\"output.css\"), options);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrysbiz%2Flesscss-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabrysbiz%2Flesscss-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrysbiz%2Flesscss-compiler/lists"}