Use postcss instead of @adobe/css-tools for css parsing#314
Use postcss instead of @adobe/css-tools for css parsing#314jgerigmeyer merged 4 commits intomainfrom
Conversation
jgerigmeyer
commented
Jun 30, 2025
- Replaces @adobe/css-tools with postcss for CSS parsing and printing
- Adds prettier for consistent formatting of printed CSS
- Fixes sass-true fails to parse non-standard at-rules #313
jamesnw
left a comment
There was a problem hiding this comment.
I read through the code, and the changes look good. A few questions, but nothing blocking!
| const parseAssertion: Parser = function (rule, ctx) { | ||
| if (isCommentNode(rule)) { | ||
| const text = rule.comment?.trimStart(); | ||
| const text = rule.text.trim(); |
There was a problem hiding this comment.
This is changing from trimStart() to trim(). Would this account for the difference in https://github.com/oddbird/true/pull/314/files#r2176052308?
There was a problem hiding this comment.
No -- PostCSS automatically trims the whitespace from comments, and stores the original whitespace in rule.raws.left and rule.raws.right. So I think this trim() isn't really needed, but it also doesn't hurt.
| passed: true, | ||
| output: | ||
| '/* Some loud comment */\n\n.test-output {\n -property: value;\n}', | ||
| '/* Some loud comment */\n.test-output {\n -property: value;\n}', |
There was a problem hiding this comment.
Is this a breaking change? Or just an internal change that won't impact users?
There was a problem hiding this comment.
This is internal, and shouldn't impact users.
|
@mirisuzanne Does this look okay to you? If so, I might do an alpha release so that users can test it. |
mirisuzanne
left a comment
There was a problem hiding this comment.
@jgerigmeyer I don't know most of the internals here, but if the tests pass, it looks fine to me. :)