-
Notifications
You must be signed in to change notification settings - Fork 937
chore: use emotion for styling (pt. 5) #10261
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
Conversation
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.
If the stories are ok, I'm ok! 👍
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.
Sorry – wasn't able to finish the review until now. Everything looks good as usual – just had some Emotion questions
}, | ||
}, | ||
const styles = { | ||
root: (theme) => css` |
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.
Just a question for my own understanding: is there a difference between an interpolation function returning an object, vs a tagged css template literal? Is the main use case to enable the &
selectors, or would something like this still be possible via object syntax?
const styles = {
"&:hover": (theme) => ({
background-color: ${theme.palette.background.paper};
})
};
Stacktrace | ||
<CopyButton | ||
buttonClassName={styles.copyButton} | ||
buttonClassName={css` |
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 think there's some nuance that I'm missing. Is there anything stopping this style from being defined outside the component, and being defined via the interpolation function syntax that some of the other styles are using?
I don't expect it to matter much performance-wise – just curious
Part of #9924
Following #10149
From starting with 157 usages of makeStyles across 154 files, this changes brings us down to 69 usages across as many files.