ydoc
Version:
基于 Markdown 的静态站点生成工具
108 lines (105 loc) • 2.06 kB
CSS
.m-search {
position: absolute;
right: .64rem;
top: .32rem;
transform: translateY(-50%);
z-index: 9999;
}
.m-search-result {
display: none;
position: absolute;
width: 100vw;
right: -.64rem;
top: .48rem;
background-color: #fff;
border-radius: 4px;
box-shadow: 0 50px 100px rgba(50, 50, 93, 0.1), 0 15px 35px rgba(50, 50, 93, 0.15), 0 5px 15px rgba(0, 0, 0, 0.1);
overflow: hidden;
}
.m-search .highlight {
font-weight: bold;
color: #1890ff;
}
.m-search .icon {
font-family: ydoc;
position: absolute;
left: 16px;
top: 16px;
transform: translate(-50%, -50%);
font-size: 18px;
}
.m-search .input {
width: 150px;
border: none;
outline: none;
height: 32px;
line-height: 32px;
padding: 0 .16rem 0 .32rem;
font-size: 14px;
border-radius: 4px;
transition: all .2s;
}
.m-search .input:focus {
background-color: #fbfbfb;
}
.m-search .empty {
padding: .32rem .24rem;
text-align: center;
}
.m-search .headline {
padding: .08rem;
background-color: #1890ff;
color: #fff;
font-weight: bold;
}
.m-search .row {
display: flex;
margin: .08rem 0;
}
.m-search .subtitle {
flex: 0 0 25%;
text-align: right;
padding: .04rem .08rem;
background-color: #fff;
cursor: pointer;
transition: all .2s;
}
.m-search .subtitle:hover {
background-color: #f6f8fa;
}
.m-search .content {
flex: 1;
font-weight: bold;
border-left: 1px solid rgba(3, 17, 31, 0.14);
padding: 0 .08rem;
}
.m-search .caption {
padding: .04rem 0;
background-color: #fff;
cursor: pointer;
transition: all .2s;
display: flex;
flex-direction: column;
}
.m-search .caption:hover {
background-color: #f6f8fa;
}
.m-search .caption .title {
}
.m-search .caption .desc {
font-weight: normal;
}
/* 宽度小于 600px 时搜索结果横贯屏幕宽度 */
@media screen and (min-width: 600px) {
.m-search-result {
position: absolute;
right: 0;
width: 4rem;
}
}
/* PC 端不显示 nav 按钮 因此更靠右侧 */
@media screen and (min-width: 960px) {
.m-search {
right: .24rem;
}
}