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
{{ message }}
Repository navigation
Should not add comma separators for the @apply at-rule #4354
Hi @tmkx! I'm Dosu and I’m helping the less.js team.
This is expected behavior in Less 4.4.0: unknown at-rules like @apply are parsed generically, and when you provide multiple values, Less joins them with commas in the output. There’s no built-in way to customize this for specific at-rules or to preserve space separation automatically [source].
A practical workaround is to use string interpolation or escaping to force Less to treat the value as a single string, like this:
.box {
@apply~"h-64 w-64";
}
or
.box {
@applyescape("h-64 w-64");
}
Both will output:
.box{@apply h-64 w-64;}
There’s no official documentation or plugin support for customizing at-rule argument formatting in Less as of 4.4.0 [source].
Any fixes for this issue? I am trying to update less to the latest, but Vite can not process @apply rules, as all the @apply one-liners get processed with commas after each class.
Activity
dosubot commentedon Jul 31, 2025
Hi @tmkx! I'm Dosu and I’m helping the less.js team.
This is expected behavior in Less 4.4.0: unknown at-rules like
@applyare parsed generically, and when you provide multiple values, Less joins them with commas in the output. There’s no built-in way to customize this for specific at-rules or to preserve space separation automatically [source].A practical workaround is to use string interpolation or escaping to force Less to treat the value as a single string, like this:
or
Both will output:
There’s no official documentation or plugin support for customizing at-rule argument formatting in Less as of 4.4.0 [source].
To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.
tmkx commentedon Jul 31, 2025
Escaping is not functioning properly with prettier-plugin-tailwindcss at the moment ([email protected], [email protected]).
for the code below:
it will be formatted to:
liangskyli commentedon Aug 11, 2025
the same issues
matthew-dean commentedon Aug 18, 2025
@tmkx Less doesn't work that way. Something else must be processing this input. See: https://lesscss.org/less-preview/#eyJjb2RlIjoiI2xpYigpIHtcbiAgICAuY29sb3JzKCkge1xuICAgICAgQHByaW1hcnk6IGJsdWU7XG4gICAgICBAc2Vjb25kYXJ5OiBncmVlbjtcbiAgICB9XG4gICAgLnJ1bGVzKEBzaXplKSB7XG4gICAgICBib3JkZXI6IEBzaXplIHNvbGlkIHdoaXRlO1xuICAgIH1cbiAgfVxuICBcbiAgLmJveCB3aGVuICgjbGliLmNvbG9yc1tAcHJpbWFyeV0gPSBibHVlKSB7XG4gICAgd2lkdGg6IDEwMHB4O1xuICAgIGhlaWdodDogKCR3aWR0aCAvIDIpO1xuICB9XG4gIFxuICAuYmFyOmV4dGVuZCguYm94KSB7XG4gICAgQG1lZGlhIChtaW4td2lkdGg6IDYwMHB4KSB7XG4gICAgICB3aWR0aDogMjAwcHg7XG4gICAgICAjbGliLnJ1bGVzKDFweCk7XG4gICAgfVxuICB9IiwiYWN0aXZlVmVyc2lvbiI6IjQuNC4wIiwibWF0aCI6InBhcmVucy1kaXZpc2lvbiIsInN0cmljdFVuaXRzIjpmYWxzZX0=
matthew-dean commentedon Aug 18, 2025
@tmkx That said, I agree that adding commas is a bug.
tmkx commentedon Aug 19, 2025
yes, there are already some downstream issues: web-infra-dev/rsbuild#5688
wldrve commentedon Sep 1, 2025
Any fixes for this issue? I am trying to update less to the latest, but Vite can not process @apply rules, as all the @apply one-liners get processed with commas after each class.
fix(issue#4354): unkown at-rule expression commas
puckowski commentedon Sep 1, 2025
I took a stab at it, not tying the logic to a specific at-rule: #4366
@matthew-dean @iChenLei Would either of you be able to peer review?
fix(issue#4354): unknown at-rule expression commas
fix(issue#4354): unknown at-rule expression commas
fix(issue#4354): unknown at-rule expression commas
OverflowCat commentedon Dec 25, 2025
This also breaks UnoCSS' transformer-directives: unocss/unocss#4908 (comment)
fix(issue#4354): unknown at-rule expression commas (#4389)
Less 5 alpha.1: Jess-powered compiler preview (#19)
Less 5 alpha.1: Jess-powered compiler preview (#4487)