perf: add sidebar width to variables.scss (#1494)

This commit is contained in:
Duy Nguyen Hoang 2019-01-11 15:37:59 +08:00 committed by 花裤衩
parent 1bb9283edd
commit 5ea614fe5d
2 changed files with 11 additions and 9 deletions

View File

@ -1,15 +1,15 @@
#app { #app {
// 主体区域 // 主体区域 Main container
.main-container { .main-container {
min-height: 100%; min-height: 100%;
transition: margin-left .28s; transition: margin-left .28s;
margin-left: 180px; margin-left: $sideBarWidth;
position: relative; position: relative;
} }
// 侧边栏 // 侧边栏 Sidebar container
.sidebar-container { .sidebar-container {
transition: width 0.28s; transition: width 0.28s;
width: 180px !important; width: $sideBarWidth !important;
height: 100%; height: 100%;
position: fixed; position: fixed;
font-size: 0px; font-size: 0px;
@ -90,29 +90,29 @@
} }
.sidebar-container .nest-menu .el-submenu>.el-submenu__title, .sidebar-container .nest-menu .el-submenu>.el-submenu__title,
.sidebar-container .el-submenu .el-menu-item { .sidebar-container .el-submenu .el-menu-item {
min-width: 180px !important; min-width: $sideBarWidth !important;
background-color: $subMenuBg !important; background-color: $subMenuBg !important;
&:hover { &:hover {
background-color: $menuHover !important; background-color: $menuHover !important;
} }
} }
.el-menu--collapse .el-menu .el-submenu { .el-menu--collapse .el-menu .el-submenu {
min-width: 180px !important; min-width: $sideBarWidth !important;
} }
//适配移动端 // 适配移动端, Mobile responsive
.mobile { .mobile {
.main-container { .main-container {
margin-left: 0px; margin-left: 0px;
} }
.sidebar-container { .sidebar-container {
transition: transform .28s; transition: transform .28s;
width: 180px !important; width: $sideBarWidth !important;
} }
&.hideSidebar { &.hideSidebar {
.sidebar-container { .sidebar-container {
transition-duration: 0.3s; transition-duration: 0.3s;
transform: translate3d(-180px, 0, 0); transform: translate3d(-$sideBarWidth, 0, 0);
} }
} }
} }

View File

@ -11,3 +11,5 @@ $panGreen: #30B08F;
$menuBg:#304156; $menuBg:#304156;
$subMenuBg:#1f2d3d; $subMenuBg:#1f2d3d;
$menuHover:#001528; $menuHover:#001528;
$sideBarWidth: 180px;