sidebar.scss 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. #app {
  2. .main-container {
  3. min-height: 100%;
  4. transition: margin-left .28s;
  5. margin-left: $sideBarWidth;
  6. position: relative;
  7. }
  8. .sidebar-container {
  9. transition: width 0.28s;
  10. width: $sideBarWidth !important;
  11. background-color: $menuBg;
  12. height: 100%;
  13. position: fixed;
  14. font-size: 0px;
  15. top: 0;
  16. bottom: 0;
  17. left: 0;
  18. z-index: 1001;
  19. overflow: hidden;
  20. // reset element-ui css
  21. .horizontal-collapse-transition {
  22. transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
  23. }
  24. .scrollbar-wrapper {
  25. overflow-x: hidden !important;
  26. }
  27. .el-scrollbar__bar.is-vertical {
  28. right: 0px;
  29. }
  30. .el-scrollbar {
  31. height: 100%;
  32. }
  33. &.has-logo {
  34. .el-scrollbar {
  35. height: calc(100% - 50px);
  36. }
  37. }
  38. .is-horizontal {
  39. display: none;
  40. }
  41. a {
  42. display: inline-block;
  43. width: 100%;
  44. overflow: hidden;
  45. }
  46. .svg-icon {
  47. margin-right: 16px;
  48. }
  49. .sub-el-icon {
  50. margin-right: 12px;
  51. margin-left: -2px;
  52. }
  53. .el-menu {
  54. border: none;
  55. height: 100%;
  56. width: 100% !important;
  57. }
  58. // menu hover
  59. .submenu-title-noDropdown,
  60. .el-submenu__title {
  61. &:hover {
  62. background-color: $menuHover !important;
  63. }
  64. }
  65. .is-active>.el-submenu__title {
  66. color: $subMenuActiveText !important;
  67. }
  68. & .nest-menu .el-submenu>.el-submenu__title,
  69. & .el-submenu .el-menu-item {
  70. min-width: $sideBarWidth !important;
  71. background-color: $subMenuBg !important;
  72. &:hover {
  73. background-color: $subMenuHover !important;
  74. }
  75. }
  76. }
  77. .hideSidebar {
  78. .sidebar-container {
  79. width: 54px !important;
  80. }
  81. .main-container {
  82. margin-left: 54px;
  83. }
  84. .submenu-title-noDropdown {
  85. padding: 0 !important;
  86. position: relative;
  87. .el-tooltip {
  88. padding: 0 !important;
  89. .svg-icon {
  90. margin-left: 20px;
  91. }
  92. .sub-el-icon {
  93. margin-left: 19px;
  94. }
  95. }
  96. }
  97. .el-submenu {
  98. overflow: hidden;
  99. &>.el-submenu__title {
  100. padding: 0 !important;
  101. .svg-icon {
  102. margin-left: 20px;
  103. }
  104. .sub-el-icon {
  105. margin-left: 19px;
  106. }
  107. .el-submenu__icon-arrow {
  108. display: none;
  109. }
  110. }
  111. }
  112. .el-menu--collapse {
  113. .el-submenu {
  114. &>.el-submenu__title {
  115. &>span {
  116. height: 0;
  117. width: 0;
  118. overflow: hidden;
  119. visibility: hidden;
  120. display: inline-block;
  121. }
  122. }
  123. }
  124. }
  125. }
  126. .el-menu--collapse .el-menu .el-submenu {
  127. min-width: $sideBarWidth !important;
  128. }
  129. // mobile responsive
  130. .mobile {
  131. .main-container {
  132. margin-left: 0px;
  133. }
  134. .sidebar-container {
  135. transition: transform .28s;
  136. width: $sideBarWidth !important;
  137. }
  138. &.hideSidebar {
  139. .sidebar-container {
  140. pointer-events: none;
  141. transition-duration: 0.3s;
  142. transform: translate3d(-$sideBarWidth, 0, 0);
  143. }
  144. }
  145. }
  146. .withoutAnimation {
  147. .main-container,
  148. .sidebar-container {
  149. transition: none;
  150. }
  151. }
  152. }
  153. // when menu collapsed
  154. .el-menu--vertical {
  155. &>.el-menu {
  156. .svg-icon {
  157. margin-right: 16px;
  158. }
  159. .sub-el-icon {
  160. margin-right: 12px;
  161. margin-left: -2px;
  162. }
  163. }
  164. .nest-menu .el-submenu>.el-submenu__title,
  165. .el-menu-item {
  166. &:hover {
  167. // you can use $subMenuHover
  168. background-color: $menuHover !important;
  169. }
  170. }
  171. // the scroll bar appears when the subMenu is too long
  172. >.el-menu--popup {
  173. max-height: 100vh;
  174. overflow-y: auto;
  175. &::-webkit-scrollbar-track-piece {
  176. background: #d3dce6;
  177. }
  178. &::-webkit-scrollbar {
  179. width: 6px;
  180. }
  181. &::-webkit-scrollbar-thumb {
  182. background: #99a9bf;
  183. border-radius: 20px;
  184. }
  185. }
  186. }