swan-docs
Version:
344 lines (320 loc) • 6.9 kB
CSS
header {
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 60px;
line-height: 60px;
box-shadow: 0 1px 4px 0 rgba(6, 0, 1, 0.07);
box-sizing: border-box;
z-index: 9999;
background: #fff;
}
.m-doc-nav-btn {
display: none;
}
.m-doc-logo-wrapper {
width: 250px;
float: left;
}
.m-doc-logo {
margin-left: 40px;
display: block;
}
.m-doc-logo img{
width: 121px;
height: 21px;
vertical-align: middle;
}
.m-doc-logo h2 {
display: inline-block;
height: 35px;
line-height: 35px;
font-size: 18px;
color: #565656;
vertical-align: middle;
}
header .m-doc-level1 {
padding-left: 95px;
margin-left: 250px;
overflow: hidden;
}
header .m-doc-crumbs-wrapper span{
margin-right: 10px;
}
header .m-doc-crumbs-wrapper span:not(:first-child):before {
content: '>';
margin-right: 10px;
}
header .m-doc-level1 ul,
header .m-doc-crumbs-wrapper {
max-width: 1195px;
margin: 0 auto;
display: none;
}
header {
transition: transform 0.35s;
transform: translateY(0px);
}
.m-doc-header-hide {
transform: translateY(-60px);
}
.m-doc-header-show {
transform: translateY(0px);
}
.m-doc-header-show-crumbs .m-doc-crumbs-wrapper {
display: block;
}
.m-doc-header-show-crumbs .m-doc-level1 ul{
display: none;
}
header .m-doc-level1 ul {
display: block;
}
header .m-doc-level1 ul li {
display: inline-block;
width: 56px;
position: relative;
text-align: center;
margin-right: 15px;
}
header .m-doc-level1 ul .m-doc-header-nav-selected:after {
content: '';
width: 100%;
position: absolute;
height: 3px;
bottom: 0;
left: 0;
background-color: #3388FF;
}
header .m-doc-level1 ul .m-doc-header-nav-selected a {
color: #3C76FF;
}
header .m-doc-level1 ul li a {
font-size: 16px;
color: #333333;
line-height: 16px;
text-decoration: none;
}
.m-mobile-doc-level1 {
display: none;
}
/* header 移动端适配 */
@media only screen and (max-width: 768px) {
header {
padding: 0 40px;
position: fixed;
top: 0;
left: 0;
background: #fff;
}
.top-search-box {
right: 50% ;
margin-right: -42px ;
}
.top-search-box-focus {
/* margin-right: -142px !important; */
width: 100% ;
background: #fff ;
margin-right: -50% ;
box-sizing: border-box;
}
.m-doc-nav-btn {
height: 60px;
line-height: 60px;
width: 24px;
float: left;
display: block;
background-image: url(../img/header_list.png);
background-size: 24px 24px;
background-repeat: no-repeat;
background-position: center;
}
.m-doc-nav-btn img {
width: 24px;
height: 24px;
vertical-align: middle;
}
.m-doc-logo-wrapper {
width: auto;
margin: 0 50px;
float: none;
display: none;
}
.m-doc-logo-wrapper .m-doc-logo {
margin-left: 0;
text-align: center;
}
.m-doc-level1 {
display: none;
}
.m-mobile-doc-level1 {
float: right;
display: block;
width: 50px;
text-align: center;
position: relative;
}
.m-mobile-doc-level1 .m-mobile-doc-header-list-mask {
display: none;
position: fixed;
top: 60px;
left: 0;
right: 0;
bottom: 0;
}
.m-mobile-level1-list-show .m-mobile-doc-header-list-mask {
display: block;
}
.m-mobile-doc-level1 .m-mobile-level1-selected {
font-size: 14px;
color: #000;
}
.m-mobile-doc-level1 .m-mobile-level1-selected span,
.m-mobile-doc-level1 .m-mobile-level1-selected img {
vertical-align: middle;
display: inline-block;
}
.m-mobile-doc-level1 .m-mobile-level1-selected img {
width: 15px;
height: 15px;
margin-left: 6px;
}
.m-mobile-level1-list-show .m-mobile-level1-selected img{
transform: rotate(180deg);
-webkit-transform: rotate(180deg);
}
.m-mobile-doc-level1 ul {
z-index: 10000;
display: none;
position: absolute;
top: 62px;
right: -20px;
background: #fff;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12);
}
.m-mobile-level1-list-show ul {
display: block;
width: 240px;
}
.m-mobile-level1-list-show ul li {
text-align: center;
display: block;
}
.m-mobile-doc-level1 ul .m-doc-header-nav-selected:after {
display: none;
}
.m-mobile-doc-level1 ul .m-doc-header-nav-selected {
background: #ebf3ff;
}
.m-mobile-doc-level1 ul li a {
color: #000;
text-decoration: none;
display: block;
width: 100%;
height: 100%;
}
.m-mobile-doc-level1 ul .m-doc-header-nav-selected a{
color: #38f;
}
}
.m-doc-search {
width: 180px;
position: absolute;
right: 30px;
top: 10px;
}
.m-doc-search input {
width: 150px;
border: 1px solid #e2e2e2;
}
.m-doc-search input:focus {
background: #e2e2e2;
}
.m-doc-search svg {
display: inline-block;
width: 18px;
height: 18px;
fill: #a2acaf;
position: absolute;
top: 1px;
left: 165px;
/* right: 1rem; */
/* top: 50%; */
/* margin-top: -0.77rem; */
z-index: 1;
}
@media only screen and (min-width: 1590px) {
header .m-doc-level1 {
padding: 0;
}
}
.top-search-box {
position: absolute;
right: 40px;
top: 13px;
width: 40px;
line-height: 1;
outline: none;
border-radius: 3px;
padding-left: 38px;
transition: width 0.1s;
}
.top-search-box-focus {
width: 280px;
background: #efefef;
}
.top-search-box form {
display: block;
padding: 0;
margin: 0;
}
.top-search-box .icon {
width: 24px;
height: 24px;
position: absolute;
left: 8px;
top: 5px;
fill: #999;
}
.reset-search-btn {
position: absolute;
right: 3px;
top: 2px;
border: none;
background: transparent;
outline: 0;
padding: 16px;
display: none;
}
.top-search-box-focus .reset-search-btn{
display: block;
}
.reset-search-btn::before,.reset-search-btn::after {
position: absolute;
width: 1px;
height: 20px;
content: ' ';
background: #ccc;
overflow: hidden;
left: 15px;
top: 5px;
}
.reset-search-btn::before {
transform:rotate(45deg);
}
.reset-search-btn::after {
transform:rotate(-45deg);
}
#local-search-input {
width: 100%;
border: none;
font-size: 16px;
line-height: 1;
outline: none;
padding: 8px 0;
background: transparent;
}
#local-search-input::-webkit-input-placeholder {
color: #999;
}