-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add label property and autoLabel option for babel-plugin-emotion #375
Conversation
This should help devs figure out where css code is written or the component that it comes from. This should also open the doors for `name` css property for devs to customize.
Codecov Report
|
- tries to get the react class - tries to get the HoC parent - legacy behavior
const parent = path.findParent(p => p.isVariableDeclarator()) | ||
return parent && t.isIdentifier(parent.node.id) ? parent.node.id.name : '' | ||
} | ||
|
||
export function getIdentifierName(path, t) { | ||
const classParent = path.findParent(p => t.isClass(p)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so we can include the name of the component the inline css call is in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm mostly cool with this but I'm wondering if we should add a label property instead, like glamor. It wouldn't be very hard to do, people would be able to add the labels manually if they wanted to and the labels could merge so you could see what the styles are composed from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think SSR will work with meta(we just have to change the regex and it'll work)
Add label property
@mitchellhamilton can you take a look at my updates. The emotion-server updates could use another look. |
What:
This should help devs figure out where css code is written or the
component that it comes from. This should also open the doors for
name
css property for devs to customize.Checklist: