[EuiCard & friends] Convert to Emotion#6110
Conversation
Todo: Investigate why `shouldRenderCustomStyles` doesn’t work
… to match proposed design from Figma
and cleaning up some outdated styles
- Added `anchorProps` to EuiToolTip and EuiBetaBadge to allow passing through more options like `css` - Added truncation to EuiBetaBadge and white background for `hollow`
- Passes through `paddingSize` and `display` for some generated styles - Explicitely sets default padding to `m` and keeps `m` when `betaBadge` exists
- Added progressive enhancement for `:has()` to propograte the outline to the whole card - Deleted the Sass files
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_6110/ |
| * A constant storing the support for the `:has()` selector through a | ||
| * media query that will only apply the content it is supported. | ||
| */ | ||
| export const euiSupportsHas = '@supports(selector(:has(p)))'; |
There was a problem hiding this comment.
Should (and where) we start documenting small style-only helpers like this?
| // TODO | ||
| // shouldRenderCustomStyles( | ||
| // <EuiCheckableCard {...checkablePanelRequiredProps} /> | ||
| // ); |
There was a problem hiding this comment.
Help? It spits out some really weird stuff in the console.
There was a problem hiding this comment.
Yeah it looks like there are a couple scenarios not accounted for in the shouldRenderCustomStyles helper.
- When the
cssprop is passed to a component that already uses Emotion - When the
styleprop is not passed to the main element in the component
Looking, but we may need shouldRenderCustomStyles to accept a some kind of config object
There was a problem hiding this comment.
Created #6152 to track the work and not block this PR
| // Todo: $euiButtonMinWidth | ||
| // Extend beta badges to at least 30% of the container's width or 112px (whichever is smaller) | ||
| ${logicalCSS('min-width', 'min(30%, 112px)')}; |
There was a problem hiding this comment.
At some point when EuiButton is converted it'd be nice to get values like this for re-use.
There was a problem hiding this comment.
This may be a good place to use the pattern @miukimiu is using in the range slider conversion
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_6110/ |
1 similar comment
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_6110/ |
|
Forgot to mark this as ready for review 😄 |
elizabetdev
left a comment
There was a problem hiding this comment.
Thanks, @cchaos.
I basically tested the cards in Chrome, Safari, Edge, and Firefox. Also in light and dark modes.
Looked at the code and LGTM! 🎉
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_6110/ |
thompsongl
left a comment
There was a problem hiding this comment.
❌ Author of the following commits did not sign a Contributor Agreement:
b6d64f9, 10a0fbe, e7f1bf4, bd0e60e, eaf4632, 122ce69, 0832a74, f962f5d, 72900e7, ebdb62fPlease, read and sign the above mentioned agreement if you want to contribute to this project
Caroline was still with Elastic when these commits were made, so we're good to merge.
Design update
There's been a updated design proposal in the Figma version for a long time (since Amsterdam style updates) that I've now included in this PR. It simplifies a lot of the original selectable card button code.
I left the de-selected button as
textcolor instead ofprimary, but it's debatable and technically still customizable.Code notes
paddingSizeanddisplayfor some generated stylesmand keepsmwhenbetaBadgeexists:has()to propograte the outline to the whole cardOther updates
anchorPropsto EuiToolTip and EuiBetaBadge to allow passing through more options likecsshollowwhich aligns with basic EuiBadge stylespaddingSizeChecklist