-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(fmt): support CSS, SCSS, Sass and Less #24870
Conversation
@g-plane any chance of this being integrated into Biomejs as well? 🥺 |
No. Underlying AST structures can't be shared. If you want to format CSS, SCSS, Sass and Less with Malva but more configurable, you can also use Malva as a dprint plugin, while using Biome to format TypeScript or JavaScript. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exciting! Looks go to me. We'll merge this soon.
Just tested this, however getting panics consistently in multiple projects due to |
@crowlKats Fixed. Please try again. |
@g-plane tried on the above files, and works nicely. tried with JSR though, and am getting
in this file https://github.com/jsr-io/jsr/blob/main/frontend/static/styles.css. And one more tweak: |
Here's an invalid syntax: LightningCSS also doesn't allow this: playground, and Biome also doesn't allow this: playground, so you may need to update it. |
@g-plane do you know why it doesn't say the line and column number of the syntax error? It would be nice to improve that. |
The parser doesn't provide line and column information, but it provides offset position so we can do some calculations. |
I see, however since tailwind is extremely spread throughout the deno styling ecosystem, especially with fresh supporting it out of the box, so we should support this, even if its not spec compliant |
@dsherret I found that Deno is already using |
@crowlKats Please test more repositories as possible so that I can fix them together, instead of releasing new version of formatter again and again. |
@crowlKats @dsherret All problems are solved. |
Thanks @g-plane! We'll check it out and merge. Since it's gonna be an unstable feature for the time being it's fine to have more bugs, we'll make sure to open issues if we get any reports. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All our cases seem covered & working, so LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@g-plane This is amazing! Super excited about having this in Deno 💯 |
This PR integrates Malva into
deno fmt
, which introduces the ability to format CSS, SCSS, Sass and Less files.On Linux x64 6.10, this PR increases about 800KiB: