How are nested LESS rules indented?
Each level of nesting adds one indent (2 spaces by default). The opening brace stays on the same line as the selector, the body indents one level, and the closing brace returns to the parent indent. This matches the convention applied by Prettier and stylelint with the standard config — nesting in LESS, SCSS, and modern CSS Nesting all use the same rule.
How should @variables be formatted?
LESS @variables are declared at the top of the file or block, one per line, with a space after the colon: @primary: #3b82f6;. Prettier preserves your declaration order. Group related variables (colors, spacing, typography) and separate groups with a blank line. Avoid mixing variable declarations with rules — keep them in a separate variables.less file or @import.
Does formatting LESS change the compiled CSS?
No. Formatting only changes whitespace in the LESS source. The lessc compiler and dart-less produce byte-identical CSS output from formatted and unformatted LESS — variables, nesting, and mixins are resolved identically regardless of source whitespace.
How are .mixin() definitions and calls formatted?
Mixin definitions follow the same brace-and-indent rule as selectors: .button-style(@color) { ... }. Mixin calls .button-style(red); fit on one line if short, or wrap arguments across lines if they exceed the column limit. Parametric mixins, default values, and rest parameters (...) are preserved exactly.
Does it preserve LESS comments?
Yes. /* CSS comments */ are preserved (LESS keeps them in the compiled output). // line comments are also preserved (LESS strips them at compile time). The formatter never deletes comments — it only re-indents them to match the surrounding block.
Can it format LESS guards (mixin guards)?
Yes. Mixin guards (when (@a > 10), when not (@b)) are preserved on the same line as the mixin signature. Multi-condition guards use commas (logical OR) and and (logical AND). The formatter does not change the guard logic — only whitespace around it.
Is the LESS I paste sent to your servers?
No. Formatting runs entirely in your browser using JavaScript. Stylesheets containing internal design-token names, brand colors, or proprietary class structures never leave your device. Open DevTools → Network and click Format to verify.
Should I use LESS or SCSS in 2026?
SCSS has the larger ecosystem (most design systems and frameworks use it). LESS remains in use because Bootstrap 3 used it and Ant Design still ships .less files for theming. Both compile to identical CSS; the choice is mostly historical. Modern CSS Nesting (Chrome 120+, Safari 16.5+) makes a third option available — native nesting without a preprocessor.