-
Notifications
You must be signed in to change notification settings - Fork 839
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
[Emotion] Fix multiple css props not being properly cascaded/merged to child props #6239
Conversation
+ add regression tests for child props
7dc2956
to
818c436
Compare
I'll be OOO until afternoon Pacific Time tomorrow. If this looks sane to folks feel free to merge/backport release this into 64.04 for elastic/kibana#140323. Otherwise I can do it when I get back |
Preview documentation changes for this PR: https://eui.elastic.co/pr_6239/ |
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.
Your PR description is one I'm going to refer back to often. It defined the problem space perfectly, outlining that Emotion CSS must be defined before {...props}
or the CSS won't merge correctly.
Commit 5f4af08 really helped me understand the intent.
The PR looks good to me. I'll wait to hear from one more reviewer before merging.
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.
Changes LGTM, pulled and verified the child prop assertion addition to shouldRenderCustomStyles
Preview documentation changes for this PR: https://eui.elastic.co/pr_6239/ |
Summary
See elastic/kibana#140706 (comment)
This PR fixes the
css
prop being passed to various childcomponentProps
not correctly mergingcss
. Apparently Emotion generally requires ourcss={}
definition to come before the{...props}
spread for it to be combined correctly.Or in the case of
EuiPageSection
, it requires the concatenation to occur in our Emotion styles array declaration (I think becausecontentProps
has no classNames on it).NOTE:
panelProps
style
. Still trying to figure out/think on how to ignore that, and it's getting late + I'm about to go on PTO so I figured I'd get this in sooner rather than later.Checklist