bixi
Version:
企业级中后台前端解决方案
82 lines (79 loc) • 1.68 kB
text/less
@drawer-width: 60vw;
.mobile {
.main-menu {
position: fixed;
top: 0;
bottom: 0;
left: 0;
z-index: 101;
max-width: 256px;
overflow: auto;
}
}
.drawer {
position: fixed;
top: 0;
z-index: 9999;
width: 100%;
height: 100%;
pointer-events: none;
> * {
transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86), opacity 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86),
box-shaow 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86), -webkit-transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
}
&-bg,
&-content-wrapper {
position: absolute;
height: 100%;
}
&-bg {
top: 0;
width: 100%;
background: #000;
opacity: 0;
}
&-content-wrapper {
left: -@drawer-width;
width: @drawer-width;
background: #fff;
box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
}
&-content {
height: 100%;
overflow: auto;
}
&-button {
position: absolute;
top: 72px;
right: -40px;
z-index: 0;
display: flex;
align-items: center;
justify-content: center;
width: 41px;
height: 40px;
font-size: 16px;
line-height: 40px;
text-align: center;
background: #fff;
border-radius: 0 4px 4px 0;
box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.15);
cursor: pointer;
pointer-events: auto;
}
&-open {
transform: translateX(@drawer-width);
transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86) 0s;
pointer-events: auto;
.drawer-bg {
opacity: 0.3;
}
}
@media (max-width: @mobile-max) {
.ant-menu-inline .ant-menu-item::after,
.ant-menu-vertical .ant-menu-item::after {
right: auto;
left: 0;
}
}
}