You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @woody-li! I'm Dosu and I'm helping the Personal team.
This looks like a genuine parsing bug. Less.js has a built-in style() function [1] that conflicts with the CSS container query style() syntax.
What's happening: When the parser encounters @container style(var(--n) = 3), the mediaFeature() parser calls declarationCall() which greedily matches style( as a Less function call [2]. It then tries to parse the contents (var(--n) = 3) as Less function arguments. Since the = operator isn't valid in that context, the parser fails to find the closing ) and throws "Missing closing ')'".
Root cause: Less.js registers style() in its function registry [3] as a built-in function that evaluates arguments as Less variables. Unlike other special functions (e.g., alpha(), boolean(), if()) which have custom parsing handlers [4], there's no context-aware logic to recognize that style() inside a @container query should be passed through as raw CSS rather than evaluated as a Less function.
The parser does have lookahead logic for detecting comparison operators like =, <, > in media/container queries [5], but this never activates because declarationCall() has already committed to parsing style( as a function call before the comparison operator handling gets a chance to run.
This appears to be a new, unreported issue — I didn't find any prior conversations or existing issues tracking it.
Activity
dosubot commentedon Jul 2, 2026
Hi @woody-li! I'm Dosu and I'm helping the Personal team.
This looks like a genuine parsing bug. Less.js has a built-in
style()function [1] that conflicts with the CSS container querystyle()syntax.What's happening: When the parser encounters
@container style(var(--n) = 3), themediaFeature()parser callsdeclarationCall()which greedily matchesstyle(as a Less function call [2]. It then tries to parse the contents (var(--n) = 3) as Less function arguments. Since the=operator isn't valid in that context, the parser fails to find the closing)and throws "Missing closing ')'".Root cause: Less.js registers
style()in its function registry [3] as a built-in function that evaluates arguments as Less variables. Unlike other special functions (e.g.,alpha(),boolean(),if()) which have custom parsing handlers [4], there's no context-aware logic to recognize thatstyle()inside a@containerquery should be passed through as raw CSS rather than evaluated as a Less function.The parser does have lookahead logic for detecting comparison operators like
=,<,>in media/container queries [5], but this never activates becausedeclarationCall()has already committed to parsingstyle(as a function call before the comparison operator handling gets a chance to run.This appears to be a new, unreported issue — I didn't find any prior conversations or existing issues tracking it.
To reply, just mention @dosu.
Docs are dead. Just use Dosu.
Fix less#4460: parse comparison/range syntax in container style() que…
Less 5 alpha.1: Jess-powered compiler preview (#4487)