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

Babel plugin should only do transformations when emotion is imported #626

Closed
DingoEatingFuzz opened this issue Apr 13, 2018 · 2 comments
Closed
Labels

Comments

@DingoEatingFuzz
Copy link

  • emotion version: 9.1.1

Problem description:

The babel plugin injects parameters to any function call for a function with the name css. This generally works, but it's possible to have a function named css that isn't emotion's css. In this case, the results are very unexpected.

I ran into it using the Webpack Blocks library, which uses css as a function shorthand for the webpack css loader.

Suggested solution:

Before doing any code transformations, check to see if emotion is even imported. This is still naive since variable shadowing could make css in a function scope still not be emotion's css despite emotion's css being imported, but it's an improvement.

@cameron-martin
Copy link
Contributor

Duplicate of #344

@emmatown emmatown mentioned this issue Apr 27, 2018
14 tasks
@Ailrun Ailrun added the bug label Jun 8, 2018
@stale
Copy link

stale bot commented Aug 7, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 7, 2018
@stale stale bot closed this as completed Aug 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants