LESS Beautify/Minify
Format or minify LESS stylesheets. Beautify adds indentation for nested rules; minify removes comments and whitespace.Overview
The LESS Beautify/Minify tool processes LESS as CSS:- Beautify — Indents rules, properties, and nested selectors with 2 spaces
- Minify — Removes comments, collapses whitespace, and strips unnecessary characters
Use Cases
LESS cleanup
Format LESS files for readability and team consistency
Build optimization
Minify LESS before compilation to reduce intermediate file size
Migration
Reformat legacy LESS files with consistent indentation
Debugging
Beautify minified LESS from third-party libraries
Actions
- Beautify
- Minify
Indents rules, properties, and nested selectors with 2 spaces per level.Input:Output:
Implementation Details
The LESS beautifier uses the same CSS beautification algorithm as the CSS Beautify tool. LESS-specific syntax (variables@var, mixins .mixin(), nesting) is treated as CSS syntax.
Source: lib/tools/engine.ts:525-528
Key logic
The beautifier does not parse LESS semantics (variable scope, mixin expansion). It formats based on CSS structure only.
LESS Feature Support
Variables
Variables
Nested rules
Nested rules
Mixins
Mixins
.rounded(10px);) are treated as properties.Keyboard Shortcuts
Cmd/Ctrl+Enter— Beautify (default)Cmd/Ctrl+Shift+C— Copy outputCmd/Ctrl+Shift+S— Download output
Related Tools
SCSS Beautify/Minify
Format or minify SCSS (Sass) stylesheets
CSS Beautify/Minify
Format or minify vanilla CSS (same algorithm)
HTML Beautify/Minify
Format or minify HTML markup