dart-sass icon indicating copy to clipboard operation
dart-sass copied to clipboard

outputStyle for modern browsers

Open mayfield opened this issue 3 weeks ago • 1 comments

Apologize if this has come up before, I couldn't find an existing issue on the subject.

Is there any interest in supporting output style/mode options that go beyond whitespace formatting? Essentially something like what we see in tools like eslint with its languageVersion: 2025. It would be nice if the css generated by sass was closer to my source scss and I could control the level of browser support I need.

You guys have done such a good job of getting browsers to support sass specs that I honestly won't need this tool much longer. But I enjoy the linting aspects and occasionally still use a sass-only feature.

mayfield avatar Nov 28 '25 21:11 mayfield

I'm not sure what this would even entail. We're strongly committed to having zero options that change the semantics of the Sass output, so this would only be able to affect language features that are identical to modern CSS but whose representations we change for compatibility reasons. The only example of this I can think of is hsb(), which we convert to hsl() for compatibility reasons. For everything else, either Sass semantics differ substantially from CSS (as for nesting) or there's no more-compatible way to support the feature at all so we emit it as authored. I definitely don't think that hwb() is enough to justify a feature like this.

nex3 avatar Dec 01 '25 22:12 nex3