From f88d61cbc60bfc526d3dff2cbaca293411370ad8 Mon Sep 17 00:00:00 2001 From: REJack Date: Sat, 22 Jan 2022 22:01:56 +0100 Subject: [PATCH] fix(4186): various collapsed sidebar-mini bugs --- build/scss/_main-sidebar.scss | 2 +- build/scss/_sidebar-mini.scss | 7 +-- build/scss/mixins/_sidebar.scss | 84 +++++++++++++++++---------------- 3 files changed, 48 insertions(+), 45 deletions(-) diff --git a/build/scss/_main-sidebar.scss b/build/scss/_main-sidebar.scss index e95a79535..32df3bdea 100644 --- a/build/scss/_main-sidebar.scss +++ b/build/scss/_main-sidebar.scss @@ -862,7 +862,7 @@ animation-fill-mode: both; } - .sidebar-collapse .sidebar & { + .sidebar-collapse .sidebar:not(:hover) & { .menu-open > .nav-treeview { max-height: 0; animation-name: fadeOut; diff --git a/build/scss/_sidebar-mini.scss b/build/scss/_sidebar-mini.scss index 2d8dc57de..53983e985 100644 --- a/build/scss/_sidebar-mini.scss +++ b/build/scss/_sidebar-mini.scss @@ -278,9 +278,6 @@ &.sidebar-focused, &:hover { - .nav-link { - width: calc(#{$sidebar-width} - #{$sidebar-padding-x} * 2); - } &:not(.hide-nav-header-on-hover) { .nav-header { display: inline-block; @@ -289,6 +286,9 @@ // Show sidebar search when hover/focus on the sidebar mini mode. &:not(.sidebar-no-expand) { + .nav-link { + width: calc(#{$sidebar-width} - #{$sidebar-padding-x} * 2); + } .form-control-sidebar { display: inline-block; } @@ -462,6 +462,7 @@ animation-duration: $transition-speed; animation-fill-mode: both; visibility: hidden; + display: inline-block; width: 0; } diff --git a/build/scss/mixins/_sidebar.scss b/build/scss/mixins/_sidebar.scss index d82b6c452..3a799f2a1 100644 --- a/build/scss/mixins/_sidebar.scss +++ b/build/scss/mixins/_sidebar.scss @@ -92,55 +92,57 @@ } } - &:hover, - &.sidebar-focused { - width: $sidebar-width; - - .brand-link { + &:not(.sidebar-no-expand) { + &:hover, + &.sidebar-focused { width: $sidebar-width; - } - .user-panel { - text-align: left; - - .image { - float: left; + .brand-link { + width: $sidebar-width; } - } - .user-panel > .info, - .sidebar .nav-sidebar .nav-link p, - .brand-text, - .logo-xl { - display: inline-block; - margin-left: 0; - animation-name: fadeIn; - animation-duration: $transition-speed; - animation-fill-mode: both; - visibility: visible; - } + .user-panel { + text-align: left; - .logo-xs { - animation-name: fadeOut; - animation-duration: $transition-speed; - animation-fill-mode: both; - visibility: hidden; - } + .image { + float: left; + } + } - .brand-image { - margin-right: .5rem; - } + .user-panel > .info, + .sidebar .nav-sidebar .nav-link p, + .brand-text, + .logo-xl { + display: inline-block; + margin-left: 0; + animation-name: fadeIn; + animation-duration: $transition-speed; + animation-fill-mode: both; + visibility: visible; + } - // Make the sidebar links, menus, labels, badges - // and angle icons disappear - .sidebar-form, - .user-panel > .info { - display: block !important; - transform: translateZ(0); - } + .logo-xs { + animation-name: fadeOut; + animation-duration: $transition-speed; + animation-fill-mode: both; + visibility: hidden; + } - .nav-sidebar > .nav-item > .nav-link > span { - display: inline-block !important; + .brand-image { + margin-right: .5rem; + } + + // Make the sidebar links, menus, labels, badges + // and angle icons disappear + .sidebar-form, + .user-panel > .info { + display: block !important; + transform: translateZ(0); + } + + .nav-sidebar > .nav-item > .nav-link > span { + display: inline-block !important; + } } } }