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: validate media queries #651

Conversation

amorriscode
Copy link
Contributor

@amorriscode amorriscode commented Apr 10, 2022

This PR adds some basic CSS media query linting (see: #480).

At work, we've shipped a couple of bugs because an invalid media query wasn't caught during code review (eg. @media (max-width: 600px). CSSType doesn't catch this, nor does Vanilla Extract. It looks like CSSType might tackle it in the future.

I wanted to see if I could put something quick together this weekend so this is that attempt. I also tried doing a RegEx attempt but that ended up getting pretty unwieldy (similar to this: https://github.com/niksy/regex-css-media-query).

Would love to hear if you had any ideas on how to tackle this!

@changeset-bot
Copy link

changeset-bot bot commented Apr 10, 2022

🦋 Changeset detected

Latest commit: 68e8d1a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@vanilla-extract/css Minor
@fixtures/features Patch
@fixtures/low-level Patch
@fixtures/recipes Patch
@fixtures/sprinkles Patch
@fixtures/themed Patch
@fixtures/unused-modules Patch
vanilla-extract-example-webpack-react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@mattcompiles mattcompiles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great PR mate 👏.

Really appreciate the time taken to follow the design of the rest of the repo, specifically the error message styling. 🍻 🚀

@mattcompiles mattcompiles merged commit 32f309f into vanilla-extract-css:master Apr 13, 2022
@seek-oss-ci seek-oss-ci mentioned this pull request Apr 13, 2022
@amorriscode amorriscode deleted the amorriscode/validate-media-query branch April 14, 2022 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants