Blame view

src/styles/sidebar.scss 6.75 KB
赵千 committed
1 2
#app {
  .main-container {
任超 committed
3
    height: calc(100% - 80px);
赵千 committed
4 5 6 7 8 9 10
    transition: margin-left 0.28s;
    margin-left: $sideBarWidth;
  }

  .sidebar-container {
    transition: width 0.28s;
    width: $sideBarWidth !important;
任超 committed
11
    height: calc(100% - #{$headerHeight});
赵千 committed
12 13
    position: fixed;
    font-size: 0px;
任超 committed
14
    top: $headerHeight;
赵千 committed
15 16
    bottom: 0;
    left: 0;
任超 committed
17
    z-index: 80;
任超 committed
18
    background-color: $subMenuBg;
任超 committed
19
    // overflow: hidden;
赵千 committed
20 21 22 23 24 25 26 27

    .horizontal-collapse-transition {
      transition: 0s width ease-in-out, 0s padding-left ease-in-out,
        0s padding-right ease-in-out;
    }

    .scrollbar-wrapper {
      overflow-x: hidden !important;
任超 committed
28
      // overflow-y: auto;
赵千 committed
29
      margin-right: 0 !important;
任超 committed
30
      height: 90vh;
赵千 committed
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66

      &::-webkit-scrollbar {
        display: none;
      }
    }

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

    .svg-icon {
      margin-right: 10px;
    }

    .sub-el-icon {
      margin-right: 12px;
      margin-left: -2px;
    }

    .el-menu {
      background-color: transparent !important;
      border: none;
      height: 100%;
      width: 100% !important;
    }

    // menu hover
    .el-menu--collapse .el-submenu__title,
    .el-menu--collapse .submenu-title-noDropdown {
      margin-left: 0px !important;
    }

    // 有子级
    .el-submenu__title {
任超 committed
67 68
      // margin-left: 13px;
      // padding-left: 10px !important;
赵千 committed
69 70
      color: $menuText;
      background-color: transparent !important;
任超 committed
71
      border-bottom: 1px solid $sliderBorderColor;
赵千 committed
72 73

      &:hover {
任超 committed
74
        color: $subMenuActiveText !important;
任超 committed
75
        background-color: $menuHover !important;
赵千 committed
76 77 78 79

        .svg-icon,
        i,
        span {
任超 committed
80
          color: $subMenuActiveText !important;
赵千 committed
81 82 83 84 85 86 87
        }
      }
    }

    // 没有子级
    .submenu-title-noDropdown {
      color: $menuText;
任超 committed
88
      border-bottom: 1px solid $sliderBorderColor;
赵千 committed
89

任超 committed
90 91 92 93
      &:hover {
        background-color: $subMenuHover !important;
      }

任超 committed
94 95 96
      // border-radius: 6px;
      // padding-left: 10px !important;
      b &:hover {
任超 committed
97 98
        color: $menuActiveText !important;
        background-color: $subMenuHover !important;
赵千 committed
99 100 101 102 103 104 105 106 107 108 109 110 111

        .svg-icon {
          color: #1ea6f8 !important;
        }

        i {
          color: #1ea6f8 !important;
        }
      }
    }

    .submenu-title-noDropdown.is-active,
    .el-submenu__title.is-active {
任超 committed
112 113
      color: $menuActiveText;
      background-color: $menuHover !important;
赵千 committed
114 115 116 117 118 119 120 121 122 123 124 125 126 127

      .svg-icon {
        color: #1ea6f8 !important;
      }

      i {
        color: #1ea6f8 !important;
      }
    }

    .submenu-title-noDropdown,
    .el-submenu__title {
      font-weight: 600;
      font-size: $sideBarFontSize;
任超 committed
128 129
      // margin: 0 10px;
      // border-radius: 6px;
赵千 committed
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159

      >i {
        color: $subMenuActiveText !important;
        transform: rotate(90deg);
        -webkit-transform: rotate(90deg);
        -moz-transform: rotate(90deg);
        -ms-transform: rotate(90deg);
        -o-transform: rotate(90deg);
        margin-right: 10px;
      }

      .svg-icon {
        font-size: 18px;
      }
    }

    .el-submenu.is-opened>.el-submenu__title .el-submenu__icon-arrow {
      transform: rotateZ(0deg) !important;
      -webkit-transform: rotateZ(0deg) !important;
      -moz-transform: rotateZ(0deg) !important;
      -ms-transform: rotateZ(0deg) !important;
      -o-transform: rotateZ(0deg) !important;
    }

    .is-active>.el-submenu__title {
      color: #fff !important;
    }

    & .nest-menu .el-submenu>.el-submenu__title,
    & .el-submenu .el-menu-item {
任超 committed
160 161


赵千 committed
162
      &.is-active {
任超 committed
163 164
        background-color: $subMenuHover !important;
        color: $menuActiveText !important;
任超 committed
165
        border-bottom: 1px solid $sliderBorderColor;
赵千 committed
166 167 168
      }

      &:hover {
任超 committed
169 170
        background-color: $subMenuHover !important;
        color: $menuActiveText !important;
任超 committed
171
        border-bottom: 1px solid $sliderBorderColor;
赵千 committed
172 173
      }

任超 committed
174
      min-width: 130px !important;
赵千 committed
175 176 177
      background-color: transparent !important;
      font-weight: 600;
      font-size: $sideBarFontSize;
任超 committed
178 179 180 181

      // margin: 0 10px;
      // border-radius: 6px;
      span {
182
        margin-left: 5px;
任超 committed
183
      }
赵千 committed
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295
    }
  }

  .hideSidebar {
    .sidebar-container {
      width: 54px !important;
    }

    .main-container {
      margin-left: 54px;
    }

    .submenu-title-noDropdown {
      padding: 0 !important;
      position: relative;

      .el-tooltip {
        padding: 0 !important;

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

        .sub-el-icon {
          margin-left: 19px;
        }
      }
    }

    .el-submenu {
      overflow: hidden;

      &>.el-submenu__title {
        padding: 0 !important;

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

        .sub-el-icon {
          margin-left: 19px;
        }

        .el-submenu__icon-arrow {
          display: none;
        }
      }
    }

    .el-menu--collapse {
      .el-submenu {
        &>.el-submenu__title {
          &>span {
            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 {
      transition: transform 0.28s;
      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 {
  &>.el-menu {
    .svg-icon {
      margin-right: 16px;
    }

    .sub-el-icon {
      margin-right: 12px;
      margin-left: -2px;
    }
  }

  .nest-menu .el-submenu>.el-submenu__title,
  .el-menu-item {
任超 committed
296 297 298
    // width: calc(100% - 12px);
    // border-top-right-radius: 8px;
    // border-bottom-right-radius: 8px;
赵千 committed
299 300
    font-weight: 600 !important;
    font-size: 15px !important;
任超 committed
301 302
    background-color: $menuHover !important;
    color: $menuText !important;
赵千 committed
303 304

    &:hover {
任超 committed
305
      background-color: $subMenuHover !important;
任超 committed
306
      opacity: .9;
赵千 committed
307 308 309 310

      .svg-icon,
      i,
      span {
任超 committed
311
        color: $menuText;
赵千 committed
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339
      }
    }
  }

  // the scroll bar appears when the subMenu is too long
  >.el-menu--popup {
    max-height: 100vh;
    overflow-y: auto;
    background-color: #32ACFE !important;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    min-width: 140px;
    padding: 12px 0;

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

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

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