[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/ |
1Copenut
left a comment
There was a problem hiding this comment.
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.
chandlerprall
left a comment
There was a problem hiding this comment.
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
cssprop being passed to various childcomponentPropsnot 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 becausecontentPropshas no classNames on it).NOTE:
panelPropsstyle. 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