Skip to content

Commit 7fdf106

Browse files
authored
Merge pull request #60 from javaistic/Update-Seacrh-Component
Update Search Component
2 parents 2a84b3a + 807277c commit 7fdf106

File tree

2 files changed

+49
-8
lines changed

2 files changed

+49
-8
lines changed

src/components/Search.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ export function Search() {
6868
type="button"
6969
ref={searchButtonRef}
7070
onClick={onOpen}
71-
className="group leading-6 font-medium flex items-center space-x-3 sm:space-x-4 hover:text-gray-600 transition-colors duration-200 w-full py-2"
71+
className="group leading-6 font-medium flex items-center space-x-3 sm:space-x-4 bg-gray-100 hover:text-gray-600 transition-colors duration-200 w-full py-1.5 px-1.5 sm:px-4 lg:px-4 rounded-lg border-2 border-gray-200"
7272
>
7373
<svg
7474
width="24"
7575
height="24"
7676
fill="none"
77-
className="text-gray-400 group-hover:text-gray-500 transition-colors duration-200"
77+
className="text-blue-400 group-hover:text-blue-500 transition-colors duration-200"
7878
>
7979
<path
8080
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
@@ -89,7 +89,7 @@ export function Search() {
8989
</span>
9090
<span
9191
style={{ opacity: browserDetected ? '1' : '0' }}
92-
className="hidden sm:block text-gray-400 text-sm leading-5 py-0.5 px-1.5 border border-gray-300 rounded-md"
92+
className="hidden sm:block text-gray-500 text-sm leading-5 py-0.5 px-1.5 border border-gray-400 rounded-md"
9393
>
9494
<span className="sr-only">Press </span>
9595
<kbd className="font-sans">

src/css/docsearch.css

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
display: flex;
5757
flex-direction: column;
5858
min-height: 0;
59-
border-radius: 1rem;
59+
border-radius: 0.7rem;
6060
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
6161
background: white;
6262
}
@@ -313,16 +313,20 @@
313313
}
314314

315315
.DocSearch-Footer {
316+
align-items: center;
316317
flex: none;
317318
display: flex;
318319
justify-content: flex-end;
319320
margin: 0 1.5rem;
320321
border-top: 1px solid theme('colors.gray.200');
321322
padding: 1.25rem 0;
322-
}
323-
324-
.DocSearch-Commands {
325-
display: none;
323+
flex-direction: row-reverse;
324+
position: relative;
325+
flex-shrink: 0;
326+
-webkit-user-select: none;
327+
-ms-user-select: none;
328+
user-select: none;
329+
justify-content: space-between;
326330
}
327331

328332
.DocSearch-Logo a {
@@ -338,6 +342,37 @@
338342
margin-left: 0.5rem;
339343
}
340344

345+
.DocSearch-Commands {
346+
color: theme('colors.gray.500');
347+
display: flex;
348+
list-style: none;
349+
margin: 0;
350+
padding: 0;
351+
font-size: 0.75rem;
352+
}
353+
354+
.DocSearch-Commands li {
355+
align-items: center;
356+
display: flex;
357+
}
358+
359+
.DocSearch-Commands li:not(:last-of-type) {
360+
margin-right: 0.8em;
361+
}
362+
363+
.DocSearch-Commands-Key {
364+
align-items: center;
365+
background: theme('colors.gray.200');
366+
border-radius: 2px;
367+
box-shadow: theme('colors.gray.600');
368+
display: flex;
369+
height: 18px;
370+
justify-content: center;
371+
margin-right: 0.4em;
372+
padding-bottom: 1px;
373+
width: 20px;
374+
}
375+
341376
.DocSearch-Hit--deleting,
342377
.DocSearch-Hit--favoriting {
343378
opacity: 0;
@@ -401,3 +436,9 @@
401436
color: theme('colors.blue.700');
402437
font-weight: 500;
403438
}
439+
440+
@media (max-width: 500px) {
441+
.DocSearch-Commands {
442+
display: none;
443+
}
444+
}

0 commit comments

Comments
 (0)