-
Notifications
You must be signed in to change notification settings - Fork 844
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 EuiProgress #5986
Conversation
674b539
to
a60bce3
Compare
jenkins test this |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5986/ |
88177fc
to
c0f6d7b
Compare
5390651
to
111f321
Compare
@cchaos and @miukimiu, I wasn't sure if just one or both of you would be interested in reviewing this PR so I tagged both of you, but please feel free to skip if it's just one. Just to follow up from my demo today on passing props/JS variables to our Emotion styles - for completeness, this approach works well for I also investigated the nested keys approach (example in prod) that @cchaos mentioned but ended up deciding against it for
which felt more repetitive than using JS logic. I'll definitely keep nested keys in mind for future cases however, I think for this specific component a flag just "felt" like it made the code cleaner. (Also we should def document nested keys in our Emotion wiki!) |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5986/ |
1 similar comment
Preview documentation changes for this PR: https://eui.elastic.co/pr_5986/ |
+ move Amsterdam override CSS into Emotion + add prefers-reduced-motion accommodation
+ pass native/determinate JS var to Emotion styles to conditionally render native vs non native CSS + remove unnecessary `::moz-progress-bar` selector - that affects the value color, not the background color, and should not have been added
- create DRY helpers for repeating native vs indeterminate selectors - start valueText styles while here - remove unnecessary isNamedColor fn/typing in favor of single var - fix playground control
+ simplify CSS: apply text styling to parent __data wrapper as opposed to both children (truncation still needs to individually be on both children) - simplify CSS: remove need for nested `+` selector by: - converting `padding-left` to `gap` - always setting text alignment to right (removes need for margin-left: auto) - always setting flex grow/flex shrink CSS (same visual effect as before)
03f0b5a
to
d725a28
Compare
Preview documentation changes for this PR: https://eui.elastic.co/pr_5986/ |
@constancecchen, now that we're using emotion, is it possible to calculate a high contrast color for the |
This comment was marked as outdated.
This comment was marked as outdated.
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! 🎉
Tested in Chrome, Safari, Edge, and Firefox. I also tested using the playground and looked at the code.
Preview documentation changes for this PR: https://eui.elastic.co/pr_5986/ |
Summary
Converts
EuiProgress
to Emotion and removes all Sass variables (no instances of usage in Kibana) and modifier classes (no usages in Kibana). I opted not to remove childeuiProgress__data
,euiProgress__label
, andeuiProgress__valueText
classes for ease of hooking in for non-Emotion users, but we could easily remove them if we prefer it.I strongly recommend following along by commit, as I did some clean-up along the way that are noted in commit messages.
Things to look out for when moving styles
-inline
and-block
(Logical properties)gap
property to add margin between items if using flexeuiCantAnimate
instead for simplicity)- [ ] Anything in the backlog that could be a quick fix for that component?Nothing I saw was a quick fix- [ ] Can any still existing.js
files be converted to TS?QA