(Trying to) Fix z-indexes with header and flyouts & adding more EuiHeader docs#3655
(Trying to) Fix z-indexes with header and flyouts & adding more EuiHeader docs#3655cchaos merged 23 commits intoelastic:masterfrom
Conversation
- By default EuiFlyout’s mask will always display below the header, but this can be adjusted by with `maskProps`
…ing `maskProps` to allow customization
And font-weight fix for amsterdam header breadcrumbs
|
This should probably be tested locally against Kibana before merging as well. But is at least ready for a review from the code and docs side. |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_3655/ |
|
What are you thoughts on creating a specific z-index concerns/customizations/practices page in the docs? |
|
Probably a good idea at some point but don't want to hold up Kibana updates for docs. |
thompsongl
left a comment
There was a problem hiding this comment.
Code LGTM. Just a couple docs edits
Co-authored-by: Greg Thompson <thompson.glowe@gmail.com>
Co-authored-by: Greg Thompson <thompson.glowe@gmail.com>
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_3655/ |
snide
left a comment
There was a problem hiding this comment.
LGTM. I clicked around in the usual places in Kibana / EUI. One small opinion, but feel free to merge! Nice work.
| className, | ||
| children, | ||
| onClick, | ||
| headerAdjacent = 'above', |
There was a problem hiding this comment.
I kind of like this propname, and kind of don't :D. Adjacent doesn't really grok with the normal language, which I think would be something like sibling. headerZindexLocation might be a little more obvious to someone looking for this or trying to figure out what it does.
It's a nit, because the doc describes it well enough.
There was a problem hiding this comment.
Yeah I struggled with the name on that one. I'll change.
| $euiZContent: $euiZLevel0; | ||
| $euiZHeader: $euiZLevel1; | ||
| $euiZContentMenu: $euiZLevel2; | ||
| $euiZFlyout: $euiZLevel3; |
There was a problem hiding this comment.
Were we really this lucky with the numbering?
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_3655/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_3655/ |
Z-index
This diagram shows the extend to which we needed more stringent attention to our z-index levels (and yet simplify at the same time).
EuiOverlayMask
This is the main component that needed more flexibility to change it's z-index. Consumers can always pass in a custom class or style prop to override the default z-index, but I also wanted to provide a quick way for flyouts associated with the header to get the correct z-index.
So I added the prop
headerZindexLocation?: 'above' | 'below'. By default all masks will stay "above" the header, but by passing "below", we adjust the z-index to be 1 level below the header:z-index: $euiZHeader - 1.Flyouts & EuiCollapsibleNav
All flyouts with
ownFocusthat include the overlay mask now apply theheaderZindexLocation="below"prop by default. Though consumers can still adjust this with the newmaskPropsprop.In SASS I added a
$euiZFlyoutvar set to3000(above header, but below mask default). So if consumers do change theheaderZindexLocationprop, they will also need to manually change the z-index of flyouts, but that is a very rare need.EuiHeader fixed
I removed any additional z-indexing for when the head is fixed since it's no longer necessary to bump it up.
Docs
I added a few new docs sections as well for some of these new props/patterns.
Overlay mask with header
Portal content in the header
I changed the EuiHeaderAlert example to talk more specifically about using popover vs flyout. In a follow-up I will create a new page for EuiHEaderAlert specifically which is lacking in docs at the moment.
The Elastic navigation pattern
At the bottom of the Header page I've added a "final" pattern with all the bits needed to display our Elastic global headers. The contents of the flyouts and popovers redirect users to that specific component as the upkeep to keep them in sync but separate is too much. I also made sure that the CodeSandbox link would render and optimized for it though CSB is broken again because of icons.
Other fixes
onClickChecklist
[ ] Checked for breaking changes and labeled appropriately🎉 😆