npm / less
less
What changed in less 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
4 breaking5 deprecations2 new APIs and options1 performance2 behavior and defaults21 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initless 435 changes
Breaking changes 4
The not keyword is no longer silently ignored when used without parentheses in conditions.
Less migrates to native ESM and no longer requires a build step.
Parens-division is now the default math setting, so parentheses are required around division-like expressions to force math evaluation.
Mixin calls now require parentheses, aligning them with syntax for calling detached rulesets.
Deprecations 5
Dynamic @charset interpolation is deprecated for removal in Less 5.x; use a static quoted @charset declaration.
Dash-only mixin names are deprecated for removal in Less 5.x; Less 4 preserves existing output while warning.
Numeric-leading and dash-only variable names are deprecated for removal in Less 5.x; Less 4 preserves existing output while warning.
Bare @variable syntax in non-value at-rule positions is deprecated.
Deprecation warnings are added for features scheduled for removal in Less 5.x.
New APIs and options 2
isdefined() can be used to test whether variables are defined.
The new rgb color syntax is supported, including space-separated channels and slash-separated alpha.
Performance 1
Hot paths are optimized.
Behavior and default changes 2
The max() function can pass through when it cannot be evaluated in Less.
The min() function can pass through when it cannot be evaluated in Less.
Fixes and other changes 21
Fixes an error when a mixin call is used as a property value.
Interpolation now supports
[...]lookups inside@{...}.Results from
escape()are no longer reparsed.Flattening nested
@mediaqueries now keeps the media type first.Math functions are left for the browser when an argument is a runtime CSS var().
Forwarding an unset variadic no longer overrides defaults in the callee.
Fixes parsing comparisons between inline condition expressions.
Resolves issue #4234 in mixing.
Comparison and range syntax is now parsed in container style() queries.
Fixes color calc inside a from expression.
Preserves spacing for container feature functions.
Avoids a TypeError when dumpLineNumbers is used with nested @supports.
Bundlers are routed to a CJS-typed UMD artifact to fix browser export interop.
Fixes handling of parentheses in media queries.
A CJS bundle is added.
Use the UMD dist/less.js to fix the webpack browser build.
CSS at-rule keywords are excluded from declarationCall parsing.
Fixes a bug affecting imports of module subpaths.
Fixes error propagation from mixin calls.
Less now handles the absence of optional dependencies.
Parent selectors are now resolved in comma-separated pseudo-selector lists.