https://github.com/squarespace/less-compiler
Less compiler in Java
https://github.com/squarespace/less-compiler
Last synced: 3 months ago
JSON representation
Less compiler in Java
- Host: GitHub
- URL: https://github.com/squarespace/less-compiler
- Owner: Squarespace
- License: apache-2.0
- Created: 2015-05-21T13:51:11.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2024-01-03T11:11:56.000Z (over 1 year ago)
- Last Synced: 2025-03-26T01:41:32.244Z (4 months ago)
- Language: Java
- Homepage:
- Size: 2.41 MB
- Stars: 19
- Watchers: 14
- Forks: 9
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Codeowners: CODEOWNERS
- Roadmap: ROADMAP.md
Awesome Lists containing this project
README
# Squarespace LESS Compiler
A Java implementation of the LESS CSS preprocessor language.
[](https://travis-ci.org/Squarespace/less-compiler)
[](https://coveralls.io/github/Squarespace/less-compiler?branch=1.x)Current [Less.js][lessjs] compatibility level: 1.3.3
License: [Apache 2.0](LICENSE.txt) ([summary][license-tldr])
Copyright (c) 2021 Squarespace, Inc.
## Project Goals
* Migrate away from use of [Node.js][nodejs] + [Less.js][lessjs] for server-side
conversion of LESS to CSS.
* Maintain compatibility with [Less.js][lessjs], tracking version 1.3.3
(Squarespace's supported version at the time of development).
* Improve performance, reduce memory usage where possible.
* Design must support additional features needed for server-side compilation.
* Design parsing package to closely track the [Less.js][lessjs] parser
structure, to simplify verifying correctness.## Features
* Performance improvement of 2-5x over Less.js when used in server context
* Improved error messages with [full stack traces](docs/error-stack-trace.md)
* [Execution trace mode](docs/execution-trace.md)
* Modular parser that supports fine-grained unit testing of syntax fragments
* High test coverage.## Differences
* JavaScript evaluation support is missing. It may return if / when we can
guarantee speed and safety of JS evaluation in the JVM (Java 8's Nashorn may
provide this).
* Final CSS structure is generated by feeding blocks and rules to a simple
model that ensures they are emitted at the correct scope in the output
document.
* Color keywords can participate in math operations.
* See more complete [list of differences](DIFFERENCES.md)## Usage
git clone [email protected]:Squarespace/squarespace-less.git
cd squarespace-less
gradle makeCli
./lessc -h[lessjs]: http://lesscss.org/ "Less.js"
[nodejs]: http://nodejs.org/ "Node.js"
[license-tldr]: https://tldrlegal.com/license/apache-license-2.0-(apache-2.0) "Apache 2.0 tl;dr"