sidebar.scss 4.6 KB

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