sidebar.scss 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. #app {
  2. .main-container {
  3. position: relative;
  4. min-height: 100%;
  5. margin-left: $sideBarWidth;
  6. transition: margin-left 0.28s;
  7. }
  8. .sidebar-container {
  9. position: fixed;
  10. top: 0;
  11. bottom: 0;
  12. left: 0;
  13. z-index: 1001;
  14. width: $sideBarWidth !important;
  15. height: 100%;
  16. overflow: hidden;
  17. background-color: $menuBg;
  18. transition: width 0.28s;
  19. // reset element-ui css
  20. .horizontal-collapse-transition {
  21. transition: 0s width ease-in-out, 0s padding-left ease-in-out,
  22. 0s padding-right ease-in-out;
  23. }
  24. .scrollbar-wrapper {
  25. overflow-x: hidden !important;
  26. }
  27. .el-scrollbar__bar.is-vertical {
  28. right: 0;
  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. .svg-icon {
  42. margin-right: 16px;
  43. }
  44. .sub-el-icon {
  45. margin-right: 12px;
  46. margin-left: -2px;
  47. }
  48. .el-menu {
  49. width: 100% !important;
  50. height: 100%;
  51. border: none;
  52. }
  53. .el-sub-menu__title {
  54. display: none;
  55. }
  56. .el-menu-item {
  57. margin: 36px auto 0;
  58. width: 210px;
  59. height: 38px;
  60. line-height: 38px;
  61. border-radius: 5px;
  62. color: #657dbc;
  63. font-size: 16px;
  64. padding-left: 30px;
  65. span {
  66. color: $menuText;
  67. }
  68. &.is-active {
  69. background: $menuHover;
  70. color: #ffffff;
  71. span {
  72. color: $menuBg;
  73. }
  74. }
  75. }
  76. }
  77. .hideSidebar {
  78. .sidebar-container {
  79. width: 54px !important;
  80. .el-menu-item {
  81. width: 44px !important;
  82. padding: 0;
  83. margin: 0 auto;
  84. .el-menu-tooltip__trigger {
  85. padding: 0;
  86. }
  87. }
  88. .svg-icon {
  89. margin: 0 auto;
  90. }
  91. }
  92. .main-container {
  93. margin-left: 54px;
  94. }
  95. }
  96. // mobile responsive
  97. .mobile {
  98. .main-container {
  99. margin-left: 0;
  100. }
  101. .sidebar-container {
  102. width: $sideBarWidth !important;
  103. transition: transform 0.28s;
  104. }
  105. &.hideSidebar {
  106. .sidebar-container {
  107. pointer-events: none;
  108. transition-duration: 0.3s;
  109. transform: translate3d(-$sideBarWidth, 0, 0);
  110. }
  111. }
  112. }
  113. .withoutAnimation {
  114. .main-container,
  115. .sidebar-container {
  116. transition: none;
  117. }
  118. }
  119. }