Skip to content
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): Basic css formatting of rules, selectors, and declarations #1256

Merged
merged 7 commits into from
Dec 22, 2023

Conversation

faultyserver
Copy link
Contributor

@faultyserver faultyserver commented Dec 19, 2023

Summary

Most of this is just the basic structuring of formats for css files. Rule lists and declaration lists get formatted and preserve their empty lines and all, selector lists get formatted onto individual lines and indented appropriately, complex and compound selectors get spaced properly.

This doesn't include anything for at-rules or custom properties or anything beyond just the plain CSS syntax (basically css 2-ish). It also doesn't include anything for pseudos, nor anything for formatting the actual values in any declarations. That will be started in the next PR.

Once this merges, I plan to create an umbrella issue covering all of the remaining nodes that need formatting support. There will also need to be support for placing comments as well.

Test Plan

I tried adding tests for each type of node that gained support, but there are also intermediate nodes that essentially get covered by other tests, so there aren't any dedicated to those.

Trying to read through the Prettier test suite, the amount of pure css tests is surprisingly low. A lot of them rely on PostCSS syntax and features, making it hard to port them over and be meaningful. More tests should be added in the future as the parser gains additional support, but for now these feel like they're working well and covering everything.

Copy link

netlify bot commented Dec 19, 2023

Deploy Preview for biomejs ready!

Name Link
🔨 Latest commit fd0d370
🔍 Latest deploy log https://app.netlify.com/sites/biomejs/deploys/6584de8e1796100008bb651e
😎 Deploy Preview https://deploy-preview-1256--biomejs.netlify.app/playground
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 93 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added A-Formatter Area: formatter L-CSS Language: CSS A-CLI Area: CLI labels Dec 19, 2023
@faultyserver faultyserver marked this pull request as ready for review December 20, 2023 04:05
@faultyserver faultyserver mentioned this pull request Dec 21, 2023
11 tasks
@faultyserver faultyserver force-pushed the faulty/css-formatter-basics branch from eff1005 to fd0d370 Compare December 22, 2023 00:55
@faultyserver faultyserver merged commit 90e1a83 into main Dec 22, 2023
@faultyserver faultyserver deleted the faulty/css-formatter-basics branch December 22, 2023 03:02
@Conaclos Conaclos added the A-Changelog Area: changelog label Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-CLI Area: CLI A-Formatter Area: formatter L-CSS Language: CSS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants