Skip to content

Fix #350 - Strip styled components referenced in css by not used in the render #351

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

Merged
merged 1 commit into from
Jul 9, 2021

Conversation

robert-hurst-cmd
Copy link
Contributor

@robert-hurst-cmd robert-hurst-cmd commented Dec 16, 2020

This PR removes CSS rules referencing unused styled components from the snapshot. See #350 for details.

The approach I took here was adding a filter for CSS rules which contain references to unknown styled component class names.

Note that this also fixes a test; "referring to other components", which was incorrectly passing, as it contained a reference to a container element that was never used.

@robert-hurst-cmd
Copy link
Contributor Author

@MicheleBertoli Let me know what you think once you're able to check this one out. Any changes needed, I'm happy to make them.

@jjaybrown
Copy link

Any update, this change would resolve our issue with jest introducing unnecessary css

@mattclough1
Copy link

@probablyup any chance we can merge this? This would clear up some CI frustrations for us

Copy link
Contributor

@quantizor quantizor left a comment

Choose a reason for hiding this comment

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

Thank you!

@quantizor quantizor merged commit 212cc64 into styled-components:main Jul 9, 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.

5 participants