In the absence of a straightforward method for adding custom links to dashboards in the Kibana sidebar menu (I've created a feature request for this), I've been experimenting with custom CSS in a TSVB Markdown panel to implement a multilevel menu of links:
(although, I acknowledge that this isn't the context-sensitive solution that I'm really after: for more details, see that feature request)
Can anyone tell me how to make this dropdown menu consistently overlay (render on top of) content in other panels? z-index
doesn't appear to be the answer; at least, I can't get that to achieve the effect I want.
Here's the Markdown (nested unordered lists), with placeholder labels and URLs:
- Item 1
- [Sub-item](#/dashboard/guid)
- [Sub-item](#/dashboard/guid)
- Item 2
- [Sub-item](#/dashboard/guid)
- [Sub-item](#/dashboard/guid)
- [Sub-item](#/dashboard/guid)
- [Sub-item](#/dashboard/guid)
- [Sub-item](#/dashboard/guid)
- [Sub-item](#/dashboard/guid)
- [Sub-item](#/dashboard/guid)
- Item 3
- [Sub-item](#/dashboard/guid)
- [Sub-item](#/dashboard/guid)
Here's the custom CSS (bare-bones prototype: it could be much fancier than this; for example, with more transitions; and I'd probably set a width on the dropdown menus):
ul, li {
margin:0; padding:0; list-style: none; position: relative;
}
li:hover {
cursor:pointer;
}
a {
text-decoration:none;
}
ul li:nth-child(3n) {
background-color: #017f75;
}
ul li:nth-child(3n+1) {
background-color: #45a29a;
}
ul li:nth-child(3n+2) {
background-color: #73b9b3;
}
/* Level 1 */
ul {
display: inline-flex; flex-wrap: wrap;
}
ul li {
display: inline-flex; padding: 0 0.5rem 0 0.5rem; text-align:left; margin-right: 0.25rem; color: #FFFFFF; height: 2rem; align-items: center;
}
ul li:hover {
transition: all 0.5s ease-out; background-color: #0d5147; color: #c9f95a;
}
/* Level 2 */
ul ul {
display: none;
}
ul ul li {
display: flex; white-space: nowrap; height: 2rem; align-items: center;
}
ul li:hover > ul {
display: flex; position: absolute; top: 2rem; left: 0;
}