-
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
[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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should (and where) we start documenting small style-only helpers like this?
// TODO | ||
// shouldRenderCustomStyles( | ||
// <EuiCheckableCard {...checkablePanelRequiredProps} /> | ||
// ); |
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.
Help? It spits out some really weird stuff in the console.
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.
Yeah it looks like there are a couple scenarios not accounted for in the shouldRenderCustomStyles
helper.
- When the
css
prop is passed to a component that already uses Emotion - When the
style
prop 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 😄 |
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.
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/ |
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.
❌ 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
text
color instead ofprimary
, but it's debatable and technically still customizable.Code notes
paddingSize
anddisplay
for some generated stylesm
and keepsm
whenbetaBadge
exists:has()
to propograte the outline to the whole cardOther updates
anchorProps
to EuiToolTip and EuiBetaBadge to allow passing through more options likecss
hollow
which aligns with basic EuiBadge stylespaddingSize
Checklist