Skip to content

Commit 3c5c4e3

Browse files
committed
Fix width of search results to be adaptive across screen sizes
1 parent cc816dc commit 3c5c4e3

File tree

1 file changed

+48
-14
lines changed

1 file changed

+48
-14
lines changed

catalog/app/globals.css

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,34 @@ body {
114114
border-radius: 1.5rem !important;
115115
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
116116
margin-top: 1rem !important;
117+
margin-left: auto !important;
118+
margin-right: auto !important;
117119
max-height: 70vh !important;
118120
overflow-y: auto !important;
119121
padding: 1.5rem !important;
122+
width: 100% !important;
123+
max-width: 100% !important;
124+
}
125+
126+
@media (min-width: 768px) {
127+
#hero-search .pagefind-ui__drawer {
128+
width: 48rem !important;
129+
max-width: 90vw !important;
130+
}
131+
}
132+
133+
@media (min-width: 1024px) {
134+
#hero-search .pagefind-ui__drawer {
135+
width: 56rem !important;
136+
max-width: 85vw !important;
137+
}
138+
}
139+
140+
@media (min-width: 1280px) {
141+
#hero-search .pagefind-ui__drawer {
142+
width: 64rem !important;
143+
max-width: 80vw !important;
144+
}
120145
}
121146

122147
/* Filters section */
@@ -195,9 +220,9 @@ body {
195220
#hero-search .pagefind-ui__result {
196221
border: 1px solid #e5e7eb !important;
197222
border-radius: 1rem !important;
198-
padding: 1.5rem !important;
199-
margin-bottom: 1rem !important;
200-
transition: all 0.2s !important;
223+
padding: 1.75rem !important;
224+
margin-bottom: 1.25rem !important;
225+
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
201226
position: relative !important;
202227
background: white !important;
203228
}
@@ -234,10 +259,11 @@ body {
234259
#hero-search .pagefind-ui__result-title {
235260
color: #111827 !important;
236261
font-weight: 700 !important;
237-
font-size: 1.125rem !important;
238-
margin-bottom: 0.75rem !important;
239-
line-height: 1.5 !important;
262+
font-size: 1.25rem !important;
263+
margin-bottom: 1rem !important;
264+
line-height: 1.4 !important;
240265
transition: color 0.2s !important;
266+
letter-spacing: -0.01em !important;
241267
}
242268

243269
#hero-search .pagefind-ui__result:hover .pagefind-ui__result-title {
@@ -248,9 +274,10 @@ body {
248274
#hero-search .pagefind-ui__result-excerpt {
249275
color: #6b7280 !important;
250276
font-size: 0.9375rem !important;
251-
line-height: 1.7 !important;
277+
line-height: 1.75 !important;
252278
margin-top: 0.5rem !important;
253-
padding-left: 0.25rem !important;
279+
padding-left: 0 !important;
280+
max-width: 85ch !important;
254281
}
255282

256283
/* Highlighted search terms */
@@ -272,20 +299,27 @@ body {
272299
/* Result metadata (tags, etc) */
273300
#hero-search .pagefind-ui__result-tags {
274301
display: flex !important;
275-
gap: 0.5rem !important;
276-
margin-top: 1rem !important;
302+
gap: 0.625rem !important;
303+
margin-top: 1.25rem !important;
277304
flex-wrap: wrap !important;
278305
}
279306

280307
#hero-search .pagefind-ui__result-tag {
281-
background: #f9fafb !important;
282-
color: #6b7280 !important;
283-
padding: 0.375rem 0.875rem !important;
308+
background: #f3f4f6 !important;
309+
color: #4b5563 !important;
310+
padding: 0.4rem 0.95rem !important;
284311
border-radius: 9999px !important;
285-
font-size: 0.75rem !important;
312+
font-size: 0.8125rem !important;
286313
font-weight: 600 !important;
287314
border: 1px solid #e5e7eb !important;
288315
text-transform: capitalize !important;
316+
transition: all 0.2s !important;
317+
}
318+
319+
#hero-search .pagefind-ui__result-tag:hover {
320+
background: #e5e7eb !important;
321+
color: #111827 !important;
322+
border-color: #d1d5db !important;
289323
}
290324

291325
/* Message when no results */

0 commit comments

Comments
 (0)