[EuiEmptyPrompt] Allow horizontal image to be smaller than 50% and added a gap#5663
Merged
cchaos merged 6 commits intoelastic:mainfrom Mar 2, 2022
Merged
Conversation
Contributor
Author
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5663/ |
1 similar comment
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5663/ |
elizabetdev
approved these changes
Mar 1, 2022
Contributor
elizabetdev
left a comment
There was a problem hiding this comment.
LGTM! 🎉
I just have a few suggestions.
| <> | ||
| <EuiEmptyPrompt | ||
| icon={<EuiImage size="fullWidth" src={illustration} alt="" />} | ||
| icon={<EuiImage size="l" src={illustration} alt="" />} |
Contributor
Comment on lines
94
to
97
| @include euiBreakpoint('l', 'xl') { | ||
| padding: $euiSizeL 0; | ||
| min-width: 33%; | ||
| max-width: 50%; | ||
| } |
Contributor
There was a problem hiding this comment.
I did just realize the image could now get really small before the responsive styles kicked in so I added a 1/3 min-width to the image. 🤷♀️ It's still mostly prioritizing the text, which is good, but it does seem awkward. Open to suggestions...
What if instead of a min-width: 33%; we change it to min-width: 40%;?
added 3 commits
March 2, 2022 14:24
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5663/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



In Shared UX, we just re-created the
NoDataViewscomponent to use the new horizontal EuiEmptyPrompt pattern:But as you can see, because the image is always forced to be 50% of the container width, it breaks the title text where we don't want it to. In the PR, we ended up forcing (
!important) amax-widthto a fixed number based on the content. This isn't ideal or flexible.Ideally, we'd allow the image to be any size, only max setting it to 50%. That's what I've done in this PR. It still ensures the left side's max-width is the same
$euiTextConstrainedMaxWidthso that text shouldn't grow indefinitely.Before (I've highlighted the image region for better visibility)

After

Example with Kibana's text

I also noticed that there was no margin between the left and right side content so if the image has full color to it's bounds it would touch the text. So I added a
gapsize equal to the specified padding. This was especially evident in the mobile version:Before

After

Checklist
[ ] Props have proper autodocs and playground toggles[ ] Added documentation[ ] Checked Code Sandbox works for any docs examples[ ] Added or updated jest and cypress tests[ ] Checked for breaking changes and labeled appropriately[ ] Checked for accessibility including keyboard-only and screenreader modes