sidebar.scss 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. #app {
  2. // 主体区域
  3. .main-container {
  4. min-height: 100%;
  5. transition: margin-left .28s;
  6. margin-left: 180px;
  7. position: relative;
  8. }
  9. // 侧边栏
  10. .sidebar-container {
  11. transition: width 0.28s;
  12. width: 180px !important;
  13. height: 100%;
  14. position: fixed;
  15. font-size: 0px;
  16. top: 0;
  17. bottom: 0;
  18. left: 0;
  19. z-index: 1001;
  20. overflow: hidden;
  21. //reset element-ui css
  22. .horizontal-collapse-transition {
  23. transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
  24. }
  25. .el-scrollbar__bar.is-vertical{
  26. right: 0px;
  27. }
  28. .scrollbar-wrapper {
  29. overflow-x: hidden!important;
  30. .el-scrollbar__view {
  31. height: 100%;
  32. }
  33. }
  34. .is-horizontal {
  35. display: none;
  36. }
  37. a {
  38. display: inline-block;
  39. width: 100%;
  40. overflow: hidden;
  41. }
  42. .svg-icon {
  43. margin-right: 16px;
  44. }
  45. .el-menu {
  46. border: none;
  47. height: 100%;
  48. width: 100% !important;
  49. }
  50. .is-active > .el-submenu__title{
  51. color: #f4f4f5!important;
  52. }
  53. }
  54. .hideSidebar {
  55. .sidebar-container {
  56. width: 36px !important;
  57. }
  58. .main-container {
  59. margin-left: 36px;
  60. }
  61. .submenu-title-noDropdown {
  62. padding-left: 10px !important;
  63. position: relative;
  64. .el-tooltip {
  65. padding: 0 10px !important;
  66. }
  67. }
  68. .el-submenu {
  69. overflow: hidden;
  70. &>.el-submenu__title {
  71. padding-left: 10px !important;
  72. .el-submenu__icon-arrow {
  73. display: none;
  74. }
  75. }
  76. }
  77. .el-menu--collapse {
  78. .el-submenu {
  79. &>.el-submenu__title {
  80. &>span {
  81. height: 0;
  82. width: 0;
  83. overflow: hidden;
  84. visibility: hidden;
  85. display: inline-block;
  86. }
  87. }
  88. }
  89. }
  90. }
  91. .sidebar-container .nest-menu .el-submenu>.el-submenu__title,
  92. .sidebar-container .el-submenu .el-menu-item {
  93. min-width: 180px !important;
  94. background-color: $subMenuBg !important;
  95. &:hover {
  96. background-color: $menuHover !important;
  97. }
  98. }
  99. .el-menu--collapse .el-menu .el-submenu {
  100. min-width: 180px !important;
  101. }
  102. //适配移动端
  103. .mobile {
  104. .main-container {
  105. margin-left: 0px;
  106. }
  107. .sidebar-container {
  108. transition: transform .28s;
  109. width: 180px !important;
  110. }
  111. &.hideSidebar {
  112. .sidebar-container {
  113. transition-duration: 0.3s;
  114. transform: translate3d(-180px, 0, 0);
  115. }
  116. }
  117. }
  118. .withoutAnimation {
  119. .main-container,
  120. .sidebar-container {
  121. transition: none;
  122. }
  123. }
  124. }
  125. .el-menu--vertical{
  126. & >.el-menu{
  127. .svg-icon{
  128. margin-right: 16px;
  129. }
  130. }
  131. }