-
-
Notifications
You must be signed in to change notification settings - Fork 541
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(css_formatter): ValueListLayout::SingleLine #2226
Conversation
✅ Deploy Preview for biomejs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Parser conformance results onjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
CodSpeed Performance ReportMerging #2226 will not alter performanceComparing Summary
|
What are the conditions to have everything on a single line? |
Lets start with the example We've encountered an issue with an extra indent when there's only one parameter in a list. //Biome
a: linear-gradient(
180deg,
180deg,
180deg,
180deg,
180deg,
180deg,
180deg,
180deg
); <--- Here
//Prettier
a: linear-gradient(
180deg,
180deg,
180deg,
180deg,
180deg,
180deg,
180deg,
180deg
); Although I'm still grappling with understanding Prettier's code, it appears that this function is responsible for formatting the right side of a property (though not exactly as you might expect). It employs a complex logic, but essentially boils down to three conditionals: if (isControlDirective) {
return group(indent(parts));
}
if (insideURLFunctionInImportAtRuleNode(path)) {
return group(fill(parts));
}
return group(indent(fill(parts))); We can skip it has for the first case:
and for the second case:
The difference between them is
I'm reconsidering the naming convention used. Perhaps calling it |
Yeah that's a good suggestion. |
01c8549
to
88a1097
Compare
Summary
This PR updates the
component_value_list
in the CSS formatter to includeValueListLayout::SingleLine
format. It also refactors the function to determine the layout style according to the list length. This change anticipates further support for one-per-line comma-separated listsTest Plan
cargo test