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): media and container queries #1294

Merged
merged 2 commits into from
Dec 22, 2023
Merged

Conversation

faultyserver
Copy link
Contributor

Summary

#1285. whew there are a bunch of nodes for at rules with queries. Thankfully they're all pretty straightforward and combine well.

Checking with Prettier, it looks like they don't really do any parsing of media and container queries and just print them out almost verbatim. They use a fill and effectively treat it just like a normal selector list (each entry is comma separated, everything within the entry is another fill with space separators). I think this implementation gets pretty close to that, but we'll have to write some stress/fuzz tests to compare against Prettier for full compatibility, since their tests don't really cover everything in great detail.

Test Plan

The @media tests from Prettier are actually pretty good! So I just copied that over as the spec test, then copied over the parser tests for @container and added some variations to cover whitespace and newlines in there.

Copy link

netlify bot commented Dec 22, 2023

Deploy Preview for biomejs canceled.

Name Link
🔨 Latest commit d70092e
🔍 Latest deploy log https://app.netlify.com/sites/biomejs/deploys/6585299fb3bf360008962d37

@github-actions github-actions bot added A-Formatter Area: formatter L-CSS Language: CSS labels Dec 22, 2023
@faultyserver faultyserver mentioned this pull request Dec 22, 2023
11 tasks
@faultyserver faultyserver merged commit 934fa66 into main Dec 22, 2023
18 checks passed
@faultyserver faultyserver deleted the faulty/css-queries branch December 22, 2023 18:30
@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-Formatter Area: formatter L-CSS Language: CSS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants