[Emotion] Convert EuiText, EuiTextAlign, and EuiTextColor#5895
[Emotion] Convert EuiText, EuiTextAlign, and EuiTextColor#5895cee-chen merged 57 commits intoelastic:mainfrom
Conversation
| const classes = classNames( | ||
| 'euiTextAlign', | ||
| alignmentToClassNameMap[textAlign], | ||
| className | ||
| ); | ||
| const styles = euiTextAlignStyles(); | ||
| const cssStyles = [styles.euiTextAlign, styles[textAlign]]; | ||
|
|
||
| return ( | ||
| <div className={classes} {...rest}> |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5895/ |
cchaos
left a comment
There was a problem hiding this comment.
Some early feedback after a quick scan of the code except for the styles.
86ca02e to
36be668
Compare
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5895/ |
TODO: EuiCode variables were not converted, per direction from Caroline
- simplifies usage
+ convert optional params to an options object + clean up euiFontSize and euiTitle fns - remove `scale` fallback since the utils don't really make sense without that param, and remove rem fallbacks in place of just single options fallback
- since there isn't a .9 scale size, we should just use `em` to make it relative - since `.euiCode` also uses `.9em`, we can now remove the `:not()` selector
- attempting to account for `em` margins + add :not(:last-child) selector per Caroline's request
…file - might as well do it while I'm here and thinking about it + expanded our logicals helper to include all logical `border` properties, since the converted CSS uses this
+ switch to logical properties
- text alignment already has its own CSS utils that users can call directly (that we can also convert any Kibanau sage into), so I feel very safe making this change, and I'd rather people not continue to hook into these classNames
- since they're no longer setting CSS - we should convert Kibana usages to the component
|
I'll do a final check, but I think it's important to also get an eng review. |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5895/ |
1 similar comment
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5895/ |
I don't especially want to throw a brand new engineer into a super large PR (2k~ lines and 70+ files) that's had a bunch of disparate changes and back and forth (i.e., no easy git commit history to follow). I strongly think this is a waste of their time and ours. Can we limit the code review we're requesting to a specific set of files you feel concerned about in terms of code quality? For example, would you want them to examine only the |
|
Yes exactly, I mean to look at the trickier bits of code like you mentioned, the tests, clones, and mixins. |
|
Thanks for clarifying Caroline! @thompsongl, would you mind doing engineering review on only the following components/files:
|
|
jenkins test this |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5895/ |
thompsongl
left a comment
There was a problem hiding this comment.
Code changes look good 👍
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5895/ |
|
Jenkins, test this |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5895/ |
Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5895/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5895/ |

Summary
Woof, this ended up being much larger than I thought it would be 💦 I strongly recommend following along by commit, in the following order:
customScaleproperty to our typography utils and creating an optional obj of properties instead of passing 4+ args)logicalsutilities, LMK if we are OK with this, if not I can revert and just useborder-inline-start-widthdirectly)makeHighContrastColorfunction or if that's already baked in)Checklist
-inlineand-block(Logical properties)- [ ] Convert global Sass vars to JS version like sizing- [ ] Usegapproperty to add margin between items if using flex- [ ] Can any still existing.jsfiles be converted to TS?- [ ] All animations or transitions are wrapped ineuiCanAnimateQA