hexo-theme-stellar/source/css/_components/sidebar/search.styl

110 lines
2.3 KiB
Stylus
Raw Normal View History

2022-12-09 23:56:58 +08:00
.search-wrapper
width: 100%
>.search-form
position: sticky
2024-01-17 00:27:48 +08:00
margin-bottom: 8px
2022-12-09 23:56:58 +08:00
top: 1rem
2024-01-17 00:27:48 +08:00
height: 40px
2022-12-09 23:56:58 +08:00
display: flex
flex-direction: row
align-items: center
2022-12-16 14:53:08 +08:00
transition: 0.38s ease-out
z-index: 0
2024-01-17 00:27:48 +08:00
border-radius: $border-bar
2024-01-31 22:45:07 +08:00
color: var(--text)
2024-01-17 00:27:48 +08:00
background: var(--alpha50)
&:has(input:focus)
background: var(--alpha100)
2022-12-09 23:56:58 +08:00
.search-input
width: 100%
box-sizing: border-box
2022-12-15 00:45:48 +08:00
font-family: $ff-body
2024-02-02 00:36:01 +08:00
font-size: $fs-14
2024-01-17 00:27:48 +08:00
padding: 12px 0
2024-01-31 22:45:07 +08:00
color: var(--text)
2024-01-17 00:27:48 +08:00
.search-button
border-radius: $border-bar
2024-02-02 00:36:01 +08:00
display: flex
align-items: center
height: 40px
svg
2024-02-02 14:53:35 +08:00
height: 1rem
width: 40px
2024-02-02 00:36:01 +08:00
margin-left: 4px
color: var(--text-p2)
2024-02-02 14:53:35 +08:00
fill: currentColor
2024-02-02 00:36:01 +08:00
path[p-id="1562"]
color: $color-theme
2024-01-13 01:00:50 +08:00
2024-01-17 22:57:52 +08:00
&[searching='true']
2024-02-02 00:36:01 +08:00
.search-button
2024-01-17 22:57:52 +08:00
path[p-id="1562"]
color: $c-green
2024-01-13 01:00:50 +08:00
&.noresult[searching='true']
2024-02-02 00:36:01 +08:00
.search-button
2024-01-14 16:50:15 +08:00
path[p-id="1562"]
color: $c-red
2022-12-09 23:56:58 +08:00
.search-no-result
display: none
color: var(--text-p1)
text-align: center
font-size: $fs-14
padding: 2rem
2024-01-17 00:27:48 +08:00
background: var(--alpha20)
border-radius: $border-card
2022-12-09 23:56:58 +08:00
#search-result
2024-01-17 00:27:48 +08:00
max-height: 60vh
overflow: scroll
2024-01-17 14:23:12 +08:00
scrollbar-width: none
scrollbar(0, 0)
2024-01-17 00:27:48 +08:00
border-radius: $border-card
&:empty
display: none
.search-result-list
2022-12-09 23:56:58 +08:00
padding: 0
margin: 0
list-style-type: none
2024-01-17 00:27:48 +08:00
li a
display: block
background: var(--alpha20)
line-height: 1.2
padding: 0.75rem 1rem
border-radius: $border-card
trans1 background
&:hover
background: var(--alpha100)
li+li
margin-top: 8px
2022-12-09 23:56:58 +08:00
.search-result-title
color: var(--text-p1)
font-weight: 700
2024-01-31 22:45:07 +08:00
font-size: $fs-15
2022-12-09 23:56:58 +08:00
.search-result-content
overflow: hidden
color: var(--text-p3)
2024-01-18 22:11:58 +08:00
margin: 4px 0 0
2022-12-09 23:56:58 +08:00
max-height: 13em
text-align: justify
2024-01-31 22:45:07 +08:00
font-size: $fs-13
2022-12-09 23:56:58 +08:00
display: -webkit-box
-webkit-box-orient: vertical
overflow: hidden
2024-01-17 00:27:48 +08:00
-webkit-line-clamp: 2
2022-12-09 23:56:58 +08:00
.search-keyword
2024-01-18 22:11:58 +08:00
color: $c-red
border-bottom: 1px dashed $c-red
2022-12-09 23:56:58 +08:00
font-weight: bold
2024-01-18 22:11:58 +08:00
filter grayscale(25%)
2022-12-09 23:56:58 +08:00
2024-01-13 01:00:50 +08:00
.search-wrapper.noresult[searching='true']
2022-12-09 23:56:58 +08:00
.search-no-result
display: block
2024-01-17 00:27:48 +08:00
margin-bottom: 8px