-
Notifications
You must be signed in to change notification settings - Fork 841
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] Convert EuiText, EuiTextAlign, and EuiTextColor #5895
Conversation
src/components/text/text_align.tsx
Outdated
const classes = classNames( | ||
'euiTextAlign', | ||
alignmentToClassNameMap[textAlign], | ||
className | ||
); | ||
const styles = euiTextAlignStyles(); | ||
const cssStyles = [styles.euiTextAlign, styles[textAlign]]; | ||
|
||
return ( | ||
<div className={classes} {...rest}> |
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.
Preview documentation changes for this PR: https://eui.elastic.co/pr_5895/ |
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.
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/ |
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.
Code changes look good 👍
Preview documentation changes for this PR: https://eui.elastic.co/pr_5895/ |
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.
LGTM! Wasn't that fun!?
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:
customScale
property to our typography utils and creating an optional obj of properties instead of passing 4+ args)logicals
utilities, LMK if we are OK with this, if not I can revert and just useborder-inline-start-width
directly)makeHighContrastColor
function or if that's already baked in)Checklist
-inline
and-block
(Logical properties)- [ ] Convert global Sass vars to JS version like sizing- [ ] Usegap
property to add margin between items if using flex- [ ] Can any still existing.js
files be converted to TS?- [ ] All animations or transitions are wrapped ineuiCanAnimate
QA