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

Simplify media query regex for removing spaces #379

Merged
merged 1 commit into from
Jul 12, 2021

Conversation

penumbra1
Copy link
Contributor

The mediaQueryRegex does not replace the space after : if the media query has a calc, because the second capture group doesn't match it. E.g. for (max-width: calc(100px + 1px)) the space is not replaced, so toHaveStyle doesn't find the query.

I think this regex should only be concerned with the : situation, instead of matching all possible media queries. Then it wouldn't need fixes like #182.

I've also removed unnecessary eslint-disable prettier/prettier comments.

@penumbra1 penumbra1 changed the title Simplify media query space substitution regex to allow for calc Simplify media query regex for removing spaces Jun 27, 2021
@quantizor
Copy link
Contributor

@penumbra1 can you rebase this against main? thanks!

@penumbra1
Copy link
Contributor Author

@probablyup Done!

@quantizor quantizor merged commit de040e4 into styled-components:main Jul 12, 2021
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