Prettier 3.8.3
When !default or !global appears inside a string or function argument in SCSS, Prettier treats it as a Sass declaration flag instead of part of the value.
Input:
$a: "!default";
$b: unquote("!default");
$c: url("x!global");
Actual output:
$a: " !default";
$b: unquote(" !default");
$c: url("x !global");
Expected output:
$a: "!default";
$b: unquote("!default");
$c: url("x!global");
This looks like the SCSS directive detection is matching raw !default / !global text before the value is parsed, so values containing those strings get split as if they had trailing Sass flags.
I can send a fix with regression tests.
Prettier 3.8.3
When
!defaultor!globalappears inside a string or function argument in SCSS, Prettier treats it as a Sass declaration flag instead of part of the value.Input:
Actual output:
Expected output:
This looks like the SCSS directive detection is matching raw
!default/!globaltext before the value is parsed, so values containing those strings get split as if they had trailing Sass flags.I can send a fix with regression tests.