重构代码:整合sidebar相关样式到site.css样式表中,准备Client使用时方便

This commit is contained in:
Argo-MacBookPro 2018-09-16 14:41:21 +08:00
parent 27b85dd9d3
commit acd73c1433
4 changed files with 128 additions and 126 deletions

View File

@ -9,20 +9,13 @@
} }
@media (min-width: 768px) { @media (min-width: 768px) {
.sidebar { .main-content {
top: 98px; position: fixed;
bottom: 40px;
position: absolute;
overflow: auto; overflow: auto;
} }
} }
@media (min-width: 769px) { @media (min-width: 769px) {
.sidebar {
display: block;
width: 210px;
}
.main-content { .main-content {
margin-left: 210px; margin-left: 210px;
transition: none; transition: none;
@ -31,23 +24,9 @@
.main-content.open { .main-content.open {
display: block; display: block;
} }
aside {
transition: none;
transform: none;
top: 0;
right: auto;
}
} }
@media (min-height: 672px) { @media (min-height: 672px) {
.sidebar {
top: 98px;
bottom: 40px;
position: absolute;
overflow: auto;
}
.main-content { .main-content {
position: fixed; position: fixed;
overflow: auto; overflow: auto;
@ -57,12 +36,4 @@
.main-content.open { .main-content.open {
display: block; display: block;
} }
aside {
top: 0;
}
.aside.open {
transform: translate(0);
}
} }

View File

@ -60,98 +60,6 @@
text-align: left; text-align: left;
} }
aside {
transition: transform .4s ease-in-out;
transform: translate(-100%);
height: 100%;
position: absolute;
top: 98px;
bottom: 40px;
left: 0;
right: 0;
z-index: 5;
}
aside.open {
transform: translate(0);
}
.sidebar {
display: none;
overflow: auto;
width: 100%;
z-index: 5;
background: #2a3542;
}
.sidebar-menu {
padding: 20px 0;
margin-bottom: 0;
}
.sidebar-menu .dcjq-icon {
height: 17px;
width: 17px;
display: inline-block;
background: url(../images/nav-expand.png) no-repeat;
float: right;
margin-top: 3px;
}
.sidebar-menu .active .dcjq-icon {
background-position: bottom;
}
.sidebar-menu li {
margin: 5px 10px;
}
.sidebar-menu li a {
color: #aeb2b7;
display: block;
padding: 15px 10px;
transition: all 0.3s ease;
border-radius: 4px;
}
.sidebar-menu li a:hover, .sidebar-menu li a:focus {
background: #35404d;
color: #fff;
}
.sidebar-menu li a.active {
color: #FF6C60;
}
.sidebar-menu li a i {
width: 22px;
}
.sidebar-menu li .sub {
padding-left: 0;
}
.sidebar-menu li .sub li a:hover, .sidebar-menu li .sub li.active a {
color: #FF6C60;
transition: all 0.3s ease;
display: block;
}
.sidebar-menu li .sub li {
background: #35404D;
margin: 0;
padding: 0 10px 0 32px;
}
.sidebar-menu li .sub li:last-child {
border-radius: 0 0 4px 4px;
padding-bottom: 10px;
}
.sidebar-menu li .sub li a {
padding: 12px 0;
}
.affix { .affix {
position: fixed; position: fixed;
bottom: 95px; bottom: 95px;

View File

@ -31,6 +31,13 @@
flex: 0 1 auto; flex: 0 1 auto;
} }
.sidebar {
top: 98px;
bottom: 40px;
position: absolute;
overflow: auto;
}
.header { .header {
border-bottom: none; border-bottom: none;
} }
@ -42,10 +49,19 @@
.header, .site-footer { .header, .site-footer {
position: fixed; position: fixed;
} }
}
.main-content { @media (min-width: 769px) {
position: fixed; .sidebar {
overflow: auto; display: block;
width: 210px;
}
aside {
transition: none;
transform: none;
top: 0;
right: auto;
} }
} }
@ -58,4 +74,19 @@
.header, .site-footer { .header, .site-footer {
position: fixed; position: fixed;
} }
.sidebar {
top: 98px;
bottom: 40px;
position: absolute;
overflow: auto;
}
aside {
top: 0;
}
.aside.open {
transform: translate(0);
}
} }

View File

@ -10,6 +10,98 @@ body {
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
} }
aside {
transition: transform .4s ease-in-out;
transform: translate(-100%);
height: 100%;
position: absolute;
top: 98px;
bottom: 40px;
left: 0;
right: 0;
z-index: 5;
}
aside.open {
transform: translate(0);
}
.sidebar {
display: none;
overflow: auto;
width: 100%;
z-index: 5;
background: #2a3542;
}
.sidebar-menu {
padding: 20px 0;
margin-bottom: 0;
}
.sidebar-menu .dcjq-icon {
height: 17px;
width: 17px;
display: inline-block;
background: url(../images/nav-expand.png) no-repeat;
float: right;
margin-top: 3px;
}
.sidebar-menu .active .dcjq-icon {
background-position: bottom;
}
.sidebar-menu li {
margin: 5px 10px;
}
.sidebar-menu li a {
color: #aeb2b7;
display: block;
padding: 15px 10px;
transition: all 0.3s ease;
border-radius: 4px;
}
.sidebar-menu li a:hover, .sidebar-menu li a:focus {
background: #35404d;
color: #fff;
}
.sidebar-menu li a.active {
color: #FF6C60;
}
.sidebar-menu li a i {
width: 22px;
}
.sidebar-menu li .sub {
padding-left: 0;
}
.sidebar-menu li .sub li a:hover, .sidebar-menu li .sub li.active a {
color: #FF6C60;
transition: all 0.3s ease;
display: block;
}
.sidebar-menu li .sub li {
background: #35404D;
margin: 0;
padding: 0 10px 0 32px;
}
.sidebar-menu li .sub li:last-child {
border-radius: 0 0 4px 4px;
padding-bottom: 10px;
}
.sidebar-menu li .sub li a {
padding: 12px 0;
}
ul li { ul li {
list-style: none; list-style: none;
} }