From 30d4d85b3462be4f04e1ea3e562b2f837dd9b7c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?= Date: Thu, 21 Feb 2019 16:08:22 +0800 Subject: [PATCH] perf[Navbar]: add scroll bar when the subMenu is too long (#1619) --- src/styles/sidebar.scss | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/styles/sidebar.scss b/src/styles/sidebar.scss index ce619fd3..96e89be7 100644 --- a/src/styles/sidebar.scss +++ b/src/styles/sidebar.scss @@ -170,8 +170,27 @@ .nest-menu .el-submenu>.el-submenu__title, .el-menu-item { &:hover { - // You can use $subMenuHover + // you can use $subMenuHover background-color: $menuHover !important; } } + + // the scroll bar appears when the subMenu is too long + >.el-menu--popup { + max-height: 100vh; + overflow-y: auto; + + &::-webkit-scrollbar-track-piece { + background: #d3dce6; + } + + &::-webkit-scrollbar { + width: 6px; + } + + &::-webkit-scrollbar-thumb { + background: #99a9bf; + border-radius: 20px; + } + } }