mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
sidemenu: responsive sidemenu view for smallest breakpoint
For the smallest breakpoint, expands the sidemenu to be width 100% and to be toggled on or off rather than visible all the time.
This commit is contained in:
@@ -4,25 +4,34 @@
|
||||
flex-flow: column;
|
||||
flex-direction: column;
|
||||
width: $side-menu-width;
|
||||
background: $navbarBackground;
|
||||
z-index: $zindex-sidemenu;
|
||||
a:focus {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.sidemenu__logo_small_breakpoint {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sidemenu__close {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.sidemenu-open {
|
||||
.sidemenu {
|
||||
background: $side-menu-bg;
|
||||
position: initial;
|
||||
height: auto;
|
||||
box-shadow: $side-menu-shadow;
|
||||
position: relative;
|
||||
z-index: $zindex-sidemenu;
|
||||
}
|
||||
.sidemenu__top,
|
||||
.sidemenu__bottom {
|
||||
display: block;
|
||||
@include media-breakpoint-up(sm) {
|
||||
.sidemenu-open {
|
||||
.sidemenu {
|
||||
background: $side-menu-bg;
|
||||
position: initial;
|
||||
height: auto;
|
||||
box-shadow: $side-menu-shadow;
|
||||
position: relative;
|
||||
z-index: $zindex-sidemenu;
|
||||
}
|
||||
.sidemenu__top,
|
||||
.sidemenu__bottom {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,21 +50,23 @@
|
||||
position: relative;
|
||||
@include left-brand-border();
|
||||
|
||||
&.active,
|
||||
&:hover {
|
||||
background-color: $side-menu-item-hover-bg;
|
||||
@include left-brand-border-gradient();
|
||||
@include media-breakpoint-up(sm) {
|
||||
&.active,
|
||||
&:hover {
|
||||
background-color: $side-menu-item-hover-bg;
|
||||
@include left-brand-border-gradient();
|
||||
|
||||
.dropdown-menu {
|
||||
margin: 0;
|
||||
display: block;
|
||||
opacity: 0;
|
||||
top: 0px;
|
||||
// important to overlap it otherwise it can be hidden
|
||||
// again by the mouse getting outside the hover space
|
||||
left: $side-menu-width - 2px;
|
||||
@include animation('dropdown-anim 150ms ease-in-out 100ms forwards');
|
||||
z-index: $zindex-sidemenu;
|
||||
.dropdown-menu {
|
||||
margin: 0;
|
||||
display: block;
|
||||
opacity: 0;
|
||||
top: 0px;
|
||||
// important to overlap it otherwise it can be hidden
|
||||
// again by the mouse getting outside the hover space
|
||||
left: $side-menu-width - 2px;
|
||||
@include animation('dropdown-anim 150ms ease-in-out 100ms forwards');
|
||||
z-index: $zindex-sidemenu;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -152,7 +163,7 @@ li.sidemenu-org-switcher {
|
||||
}
|
||||
}
|
||||
|
||||
.sidemenu__logo {
|
||||
.sidemenu__logo, .sidemenu__logo_small_breakpoint {
|
||||
display: block;
|
||||
padding: 0.4rem 1.0rem 0.4rem 0.65rem;
|
||||
min-height: $navbarHeight;
|
||||
@@ -170,3 +181,84 @@ li.sidemenu-org-switcher {
|
||||
}
|
||||
}
|
||||
|
||||
@include media-breakpoint-down(xs) {
|
||||
.sidemenu-open {
|
||||
.navbar {
|
||||
padding-left: 60px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.sidemenu-open--xs {
|
||||
.sidemenu {
|
||||
width: 100%;
|
||||
background: $side-menu-bg;
|
||||
position: initial;
|
||||
height: auto;
|
||||
box-shadow: $side-menu-shadow;
|
||||
position: relative;
|
||||
z-index: $zindex-sidemenu;
|
||||
}
|
||||
|
||||
.sidemenu__close {
|
||||
display: block;
|
||||
font-size: $font-size-md;
|
||||
}
|
||||
|
||||
.sidemenu__top,
|
||||
.sidemenu__bottom {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.sidemenu {
|
||||
.sidemenu__logo {
|
||||
display: none;
|
||||
}
|
||||
.sidemenu__logo_small_breakpoint {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: baseline;
|
||||
|
||||
&:hover {
|
||||
background: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
.sidemenu__top {
|
||||
padding-top: 0rem;
|
||||
}
|
||||
|
||||
.side-menu-header {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.sidemenu-link {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.sidemenu-icon {
|
||||
display: none
|
||||
}
|
||||
|
||||
.dropdown-menu--sidemenu {
|
||||
display: block;
|
||||
position: unset;
|
||||
width: 100%;
|
||||
float: none;
|
||||
margin-top: 0.5rem;
|
||||
margin-bottom: 0.5rem;
|
||||
|
||||
> li > a {
|
||||
padding-left: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.sidemenu__bottom {
|
||||
.dropdown-menu--sidemenu {
|
||||
display: flex;
|
||||
flex-direction: column-reverse;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user