sidebar.scss 4.98 KB
Newer Older
耿迪迪's avatar
耿迪迪 committed
1 2 3
#app {
  .main-container {
    min-height: 100%;
4
    transition: margin-left 0.28s;
耿迪迪's avatar
耿迪迪 committed
5 6 7 8 9
    margin-left: $sideBarWidth;
    position: relative;
  }

  .sidebar-container {
10
    -webkit-transition: width 0.28s;
耿迪迪's avatar
耿迪迪 committed
11 12
    transition: width 0.28s;
    width: $sideBarWidth !important;
13
    background-color: #053b6a;
耿迪迪's avatar
耿迪迪 committed
14 15 16
    height: 100%;
    position: fixed;
    font-size: 0px;
yaqizhang's avatar
yaqizhang committed
17
    top: 80px;
耿迪迪's avatar
耿迪迪 committed
18 19 20 21
    bottom: 0;
    left: 0;
    z-index: 1001;
    overflow: hidden;
22 23 24
    -webkit-box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
    box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
    .el-menu-item {
25
      padding: 0px !important;
yaqizhang's avatar
yaqizhang committed
26 27 28 29
      margin-top: 5px;
      height: 84px;
      line-height: 30px !important;
      text-align: center;
30
      .svg-icon {
yaqizhang's avatar
yaqizhang committed
31 32 33 34 35
        margin-top: 10px;
        font-size: 30px;
        // width: 30px !important;
      }
    }
36 37 38
    reset element-ui css .horizontal-collapse-transition {
      transition: 0s width ease-in-out, 0s padding-left ease-in-out,
        0s padding-right ease-in-out;
耿迪迪's avatar
耿迪迪 committed
39 40 41 42
    }

    .scrollbar-wrapper {
      overflow-x: hidden !important;
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
      .el-menu-item:focus,
      .is-active {
        outline: none;
        // background-image: url(/static/img/item-background.0ec28f27.png);
        background-repeat: no-repeat;
        background-size: 100% 100%;
        /* background: rgba(0, 0, 0, 0); */
        color: #31eaea !important;
      }
      .el-menu-item:hover {
        outline: none;
        // background-image: url(/static/img/item-background.0ec28f27.png);
        background-repeat: no-repeat;
        background-size: 100% 100%;
        /* background: rgba(0, 0, 0, 0); */
        color: #31eaea !important;
      }
耿迪迪's avatar
耿迪迪 committed
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
    }

    .el-scrollbar__bar.is-vertical {
      right: 0px;
    }

    .el-scrollbar {
      height: 100%;
    }

    &.has-logo {
      .el-scrollbar {
        height: calc(100% - 50px);
      }
    }

    .is-horizontal {
      display: none;
    }

    a {
      display: inline-block;
      width: 100%;
      overflow: hidden;
    }

    .svg-icon {
yaqizhang's avatar
yaqizhang committed
87
      margin-right: 5px;
耿迪迪's avatar
耿迪迪 committed
88 89 90
    }

    .el-menu {
91
      background-color: #053b6a;
耿迪迪's avatar
耿迪迪 committed
92 93 94 95 96
      border: none;
      height: 100%;
      width: 100% !important;
    }

97 98
    .el-menu-item,
    .el-submenu__title {
耿迪迪's avatar
耿迪迪 committed
99 100
      overflow: hidden !important;
      text-overflow: ellipsis !important;
yaqizhang's avatar
yaqizhang committed
101
      // white-space: nowrap !important;
耿迪迪's avatar
耿迪迪 committed
102 103 104 105 106 107 108 109 110 111 112
    }

    // menu hover
    .submenu-title-noDropdown,
    .el-submenu__title {
      &:hover {
        background-color: rgba(0, 0, 0, 0.06) !important;
      }
    }

    & .theme-dark .is-active > .el-submenu__title {
yaqizhang's avatar
yaqizhang committed
113
      color: #fff !important;
耿迪迪's avatar
耿迪迪 committed
114 115
    }

116
    & .nest-menu .el-submenu > .el-submenu__title,
耿迪迪's avatar
耿迪迪 committed
117 118 119 120 121 122 123 124
    & .el-submenu .el-menu-item {
      min-width: $sideBarWidth !important;

      &:hover {
        background-color: rgba(0, 0, 0, 0.06) !important;
      }
    }

125
    & .theme-dark .nest-menu .el-submenu > .el-submenu__title,
耿迪迪's avatar
耿迪迪 committed
126
    & .theme-dark .el-submenu .el-menu-item {
127
      background-color: #053b6a !important;
耿迪迪's avatar
耿迪迪 committed
128 129

      &:hover {
yaqizhang's avatar
yaqizhang committed
130
        background-color: rgba(0, 0, 0, 0.06) !important;
耿迪迪's avatar
耿迪迪 committed
131 132 133 134 135 136
      }
    }
  }

  .hideSidebar {
    .sidebar-container {
137
      // width: 54px !important;
耿迪迪's avatar
耿迪迪 committed
138 139 140
    }

    .main-container {
141
      // margin-left: 54px;
耿迪迪's avatar
耿迪迪 committed
142 143 144
    }

    .submenu-title-noDropdown {
yaqizhang's avatar
yaqizhang committed
145
      padding: 0 0 !important;
耿迪迪's avatar
耿迪迪 committed
146 147 148 149 150
      position: relative;

      .el-tooltip {
        padding: 0 !important;

yaqizhang's avatar
yaqizhang committed
151 152 153
        // .svg-icon {
        //   margin-left: 20px;
        // }
耿迪迪's avatar
耿迪迪 committed
154 155 156 157 158 159
      }
    }

    .el-submenu {
      overflow: hidden;

160
      & > .el-submenu__title {
yaqizhang's avatar
yaqizhang committed
161
        padding: 0 0 !important;
耿迪迪's avatar
耿迪迪 committed
162 163 164 165 166 167 168 169 170

        .svg-icon {
          margin-left: 20px;
        }
      }
    }

    .el-menu--collapse {
      .el-submenu {
171 172
        & > .el-submenu__title {
          & > span {
耿迪迪's avatar
耿迪迪 committed
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
            height: 0;
            width: 0;
            overflow: hidden;
            visibility: hidden;
            display: inline-block;
          }
        }
      }
    }
  }

  .el-menu--collapse .el-menu .el-submenu {
    min-width: $sideBarWidth !important;
  }

  // mobile responsive
  .mobile {
    .main-container {
      margin-left: 0px;
    }

    .sidebar-container {
195
      transition: transform 0.28s;
耿迪迪's avatar
耿迪迪 committed
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
      width: $sideBarWidth !important;
    }

    &.hideSidebar {
      .sidebar-container {
        pointer-events: none;
        transition-duration: 0.3s;
        transform: translate3d(-$sideBarWidth, 0, 0);
      }
    }
  }

  .withoutAnimation {
    .main-container,
    .sidebar-container {
      transition: none;
    }
  }
}

// when menu collapsed
.el-menu--vertical {
218
  & > .el-menu {
耿迪迪's avatar
耿迪迪 committed
219 220 221 222 223
    .svg-icon {
      margin-right: 16px;
    }
  }

224
  .nest-menu .el-submenu > .el-submenu__title,
耿迪迪's avatar
耿迪迪 committed
225 226 227 228 229 230 231 232
  .el-menu-item {
    &:hover {
      // you can use $subMenuHover
      background-color: rgba(0, 0, 0, 0.06) !important;
    }
  }

  // the scroll bar appears when the subMenu is too long
233
  > .el-menu--popup {
耿迪迪's avatar
耿迪迪 committed
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
    max-height: 100vh;
    overflow-y: auto;

    &::-webkit-scrollbar-track-piece {
      background: #d3dce6;
    }

    &::-webkit-scrollbar {
      width: 6px;
    }

    &::-webkit-scrollbar-thumb {
      background: #99a9bf;
      border-radius: 20px;
    }
  }
}