hexo-theme-keep/source/css/layout/_partial/local-search.styl

114 lines
1.8 KiB
Stylus
Raw Normal View History

2020-04-01 12:09:06 +08:00
@require '../common/variables.styl'
$icon-size = 1.2em;
.search-pop-overlay {
display: none;
position: fixed;
2020-04-02 22:07:55 +08:00
left: 0;
top: 0;
2020-04-02 22:07:55 +08:00
height: 100%;
width: 100%;
2020-04-02 22:07:55 +08:00
background: rgba(0, 0, 0, 0.4);
z-index: $z-index-5;
}
.search-popup {
2020-04-02 22:07:55 +08:00
background: var(--background-color);
border-radius: 2px;
height: 80%;
2020-04-02 22:07:55 +08:00
left: 50%;
transform: translateX(-50%);
position: fixed;
top: 10%;
2020-04-02 22:07:55 +08:00
width: 70%;
z-index: $z-index-6;
.search-icon, .popup-btn-close {
color: var(--normal-text-color);
font-size: $icon-size;
padding: 0 10px;
display: flex;
align-items: center;
}
.popup-btn-close {
cursor: pointer;
&:hover .fa {
2020-04-02 22:07:55 +08:00
color: var(--first-text-color);
}
}
.search-header {
2020-04-02 22:07:55 +08:00
background: var(--border-color);
border-top-left-radius: 2px;
border-top-right-radius: 2px;
display: flex;
padding: 10px;
}
}
input.search-input {
background: transparent;
border: 0;
outline: 0;
width: 100%;
font-size: 1.2em;
&::-webkit-search-cancel-button {
display: none;
}
}
.search-popup {
2020-04-02 22:07:55 +08:00
.search-input-container {
flex-grow: 1;
padding: 2px;
}
ul.search-result-list {
2020-04-02 22:07:55 +08:00
margin: 10px 5px;
width: 100%;
}
p.search-result {
2020-04-02 22:07:55 +08:00
border-bottom: 1px solid var(--border-color);
padding-bottom: 10px;
margin-bottom: 20px;
}
a.search-result-title {
font-weight: bold;
}
.search-keyword {
2020-04-02 22:07:55 +08:00
border-bottom: 1px dashed var(--primary-color);
color: var(--primary-color);
font-weight: bold;
}
#search-result {
display: flex;
height: calc(100% - 55px);
overflow: auto;
padding: 5px 25px;
}
#no-result {
2020-04-02 22:07:55 +08:00
color: var(--third-text-color);
margin: auto;
}
2020-04-02 22:07:55 +08:00
}
@media screen and (max-width: $media-max-width) {
.search-popup {
width: 80%;
}
}