@@ -10,138 +10,195 @@ $search-z-index-focus: 12;
1010 display : none ;
1111 }
1212
13- .pagefind-ui__search-input ,
14- .pagefind-ui__message {
15- font-family : " Roboto" , Arial , Helvetica , sans-serif ;
16- font-weight : 400 ;
17- }
18-
19- .pagefind-ui__message {
20- padding : 1rem ;
21- }
13+ .pagefind-ui {
14+ width : 100% ;
2215
23- .pagefind-ui__results-area {
24- margin-top : 0 ;
25- max-height : 50vh ;
26- padding : 0 1rem ;
27- overflow-y : scroll ;
16+ & __form {
17+ position : relative ;
18+
19+ & ::before {
20+ content : " search" ;
21+ position : absolute ;
22+ top : 23px ;
23+ left : 20px ;
24+ z-index : $search-z-index + 1 ;
25+ font-family : " Material Symbols Rounded" ;
26+ opacity : 0.7 ;
27+ pointer-events : none ;
28+ line-height : 1 ;
29+ }
30+ }
2831
29- @media (max-width : #{$breakpoint-md } ) {
30- max-height : calc (100 dvh - 17rem );
32+ & __message {
33+ padding : 1rem ;
34+ margin-bottom : 0 ;
3135 }
32- }
3336
34- .pagefind-ui__results li :last-child {
35- border-bottom : none ;
36- }
37+ & __results-area {
38+ max-height : 50vh ;
39+ padding : 0 1rem ;
40+ overflow-y : scroll ;
3741
38- input .pagefind-ui__search-input {
39- z-index : $search-z-index ;
40- outline : 0.2rem solid transparent ;
41- border : var (--border );
42- box-shadow : var (--box-shadow );
43- border-radius : var (--border-radius-l );
42+ @media (max-width : #{$breakpoint-md } ) {
43+ max-height : calc (100 dvh - 17rem );
44+ }
45+ }
4446
45- @include focus-indicator (0.2rem );
47+ & __results {
48+ padding-left : 0 ;
49+ margin-bottom : 0 ;
50+ }
4651
47- & ::placeholder {
48- opacity : 0.7 ;
52+ & __search-input {
53+ z-index : $search-z-index ;
54+ outline : 0.2rem solid transparent ;
55+ border : var (--border );
56+ box-shadow : var (--box-shadow );
57+ border-radius : var (--border-radius-l );
58+ height : 64px ;
59+ background-color : var (--bg-default );
4960 color : var (--color-body );
61+ padding : 0 70px 0 54px ;
62+ font-size : 2rem ;
63+ position : relative ;
64+ display : flex ;
65+ width : 100% ;
66+ box-sizing : border-box ;
67+ font-family : " Roboto" , Arial , Helvetica , sans-serif ;
68+
69+ @include focus-indicator (0.2rem );
70+
71+ & ::placeholder {
72+ opacity : 0.7 ;
73+ color : var (--color-body );
74+ }
75+
76+ // When results are visible
77+ & :has (
78+ + .pagefind-ui__search-clear
79+ + .pagefind-ui__drawer
80+ .pagefind-ui__results-area
81+ ) {
82+ border-radius : var (--border-radius-l ) var (--border-radius-l ) 0 0 ;
83+ }
5084 }
5185
52- // This selector is used to identify if search results are visible
53- & :has (
54- + .pagefind-ui__search-clear
55- + .pagefind-ui__drawer
56- .pagefind-ui__results-area
57- ) {
58- border-radius : var (--border-radius-l ) var (--border-radius-l ) 0 0 ;
86+ & __search-clear {
87+ display : none ;
5988 }
60- }
61-
62- button .pagefind-ui__search-clear {
63- display : none ;
64- }
65-
66- .pagefind-ui__suppressed {
67- display : none ;
68- }
6989
70- .pagefind-ui__form ::before {
71- z-index : $search-z-index + 1 ;
72- }
73-
74- .pagefind-ui__drawer {
75- background-color : var (--bg-default );
76- padding : 0 ;
77- overscroll-behavior : contain ;
78- overflow : hidden ;
79- position : absolute ;
80- width : 100% ;
81- z-index : $search-z-index ;
82- border : var (--border );
83- border-radius : 0 0 var (--border-radius-l ) var (--border-radius-l );
84- }
85-
86- .pagefind-ui__result {
87- padding : 2rem 0 ;
88- margin : 0 1rem ;
89- border-top : 0.2rem solid grey ;
90- }
91-
92- .pagefind-ui__result-inner ,
93- .pagefind-ui__result-thumb {
94- margin-top : 0 ;
95- }
96-
97- .pagefind-ui__result-thumb {
98- width : 10rem ;
99-
100- @media (max-width : #{$breakpoint-md } ) {
90+ & __suppressed {
10191 display : none ;
10292 }
103- }
10493
105- .pagefind-ui__result-link {
106- color : var (--link-default );
107- text-decoration : underline ;
108- border-radius : var (--border-radius-s );
94+ & __drawer {
95+ background-color : var (--bg-default );
96+ overscroll-behavior : contain ;
97+ overflow : hidden ;
98+ position : absolute ;
99+ width : 100% ;
100+ z-index : $search-z-index ;
101+ border : var (--border );
102+ border-radius : 0 0 var (--border-radius-l ) var (--border-radius-l );
103+ box-sizing : border-box ;
104+ }
109105
110- & :hover ,
111- & :focus {
112- color : var (--link-hovered );
106+ & __result {
107+ list-style-type : none ;
108+ display : flex ;
109+ align-items : flex-start ;
110+ gap : 3.2rem ;
111+ padding : 2rem 0 ;
112+ border-top : 0.2rem solid grey ;
113+ margin : 0 1rem ;
114+
115+ & -inner ,
116+ & -thumb {
117+ margin-top : 0 ;
118+ }
119+
120+ & -thumb {
121+ width : 10rem ;
122+ height : auto ;
123+ aspect-ratio : 3 / 2 ;
124+
125+ @media (max-width : #{$breakpoint-md } ) {
126+ display : none ;
127+ }
128+ }
129+
130+ & -title {
131+ display : inline-block ;
132+ font-weight : 700 ;
133+ margin : 0 ;
134+ }
135+
136+ & -nested {
137+ display : flex ;
138+ flex-direction : column ;
139+ padding-top : 0.8rem ;
140+ padding-left : 2.4rem ;
141+
142+ .pagefind-ui__result-link {
143+ font-size : 1.8rem ;
144+ }
145+
146+ .pagefind-ui__result-link ::before {
147+ content : " subdirectory_arrow_right" ;
148+ font-family : " Material Symbols Rounded" ;
149+ position : absolute ;
150+ left : -2.4rem ;
151+ }
152+ }
153+
154+ & -excerpt {
155+ margin-bottom : 0 ;
156+ margin-top : 0.4rem ;
157+ }
113158 }
114- }
115159
116- .pagefind-ui__result- link:hover ,
117- .pagefind-ui__result-link :focus {
118- color : var ( --link-hovered ) ;
119- }
160+ & __result- link {
161+ position : relative ;
162+ font-size : 2.2 rem ;
163+ }
120164
121- .pagefind-ui__result-link {
122- @include focus-indicator (0.2rem );
123- }
165+ & __button {
166+ border : 0.2rem solid var (--link-default );
167+ border-radius : var (--border-radius-m );
168+ background : transparent ;
169+ color : var (--body-color );
170+ height : 4.8rem ;
171+ padding : 1.2rem ;
172+ margin-bottom : 1rem ;
173+ width : 100% ;
174+ text-align : center ;
175+ font-weight : 700 ;
176+ transition :
177+ background 0.2s ,
178+ color 0.2s ;
179+
180+ & :hover ,
181+ & :focus {
182+ background : rgba ($link-hovered , 0.15 );
183+ }
184+ }
124185
125- .pagefind-ui__result-link ::before {
126- top : -0.2 rem ;
127- }
186+ & __hidden {
187+ display : none ;
188+ }
128189
129- .pagefind-ui--reset mark {
130- background-color : var (--bg-accent );
131- color : black ;
132- }
190+ & --reset {
191+ mark {
192+ background-color : var (--bg-accent );
193+ color : black ;
194+ }
195+ }
133196
134- button .pagefind-ui__button {
135- border : 0.2rem solid var (--link-default );
136- border-radius : var (--border-radius-m );
137- background : transparent ;
138- color : var (--body-color );
139- margin-top : 0 ;
140- margin-bottom : 1rem ;
141-
142- & :hover ,
143- & :focus {
144- background : rgba ($link-hovered , 0.15 );
197+ & __loading {
198+ color : var (--bg-neutral );
199+ background-color : var (--bg-neutral );
200+ border-radius : var (--border-radius-s );
201+ pointer-events : none ;
145202 }
146203 }
147204}
0 commit comments