Skip to content

Commit 0031f90

Browse files
committed
Improve search result modal stylings
1 parent d8161f1 commit 0031f90

7 files changed

Lines changed: 25 additions & 20 deletions

File tree

_TODO.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,6 @@ Maybe change the "ready..." in the hero to "get in touch..."
106106

107107
## Search Box
108108

109-
3. Maybe need a 1px border
110-
6. What happens when search query exceeds size of search box? Drop down to second line?
111-
7. Need to improve quality of search results in drop down box - maybe some description text for each item
112-
8. Style drop down box of search results from search box
113-
114109
Title box - need to squish to 75% and have it absolute in place as you scroll down, go back to 100% when you scroll back up
115110

116111
## Image generation models

src/components/Search/SearchBar/client/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,14 +428,14 @@ export class SearchBarElement extends LitElement {
428428

429429
return html`
430430
<li class="px-4 py-3 hover:bg-page-base-offset">
431-
<a class="block text-sm" href=${url}>${title}</a>
431+
<a class="block text-body" href=${url}>${title}</a>
432432
</li>
433433
`
434434
})
435435

436436
const searchFor = html`
437437
<li class="px-4 py-3 hover:bg-page-base-offset">
438-
<a class="block text-sm" href=${`/search?q=${encodeURIComponent(query)}`}>
438+
<a class="block text-body" href=${`/search?q=${encodeURIComponent(query)}`}>
439439
Search for &quot;${query}&quot;
440440
</a>
441441
</li>

src/components/Search/SearchBar/index.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const clearButtonLabel = hasInitialQuery ? 'Clear search' : 'Close search'
5151
placeholder={placeholder}
5252
value={initialQuery}
5353
class:list={[
54-
'min-w-0 flex-1 h-(--header-icon-size) bg-transparent px-4 text-sm placeholder:text-content-active border-0 focus:outline-none focus-visible:outline-none focus:ring-0 focus-visible:ring-0 focus:ring-offset-0 focus-visible:ring-offset-0',
54+
'min-w-0 flex-1 h-(--header-icon-size) bg-transparent px-4 text-base placeholder:text-content-active border-0 focus:outline-none focus-visible:outline-none focus:ring-0 focus-visible:ring-0 focus:ring-offset-0 focus-visible:ring-offset-0',
5555
!isExpandedOnLoad && 'hidden',
5656
]}
5757
/>
@@ -86,7 +86,7 @@ const clearButtonLabel = hasInitialQuery ? 'Clear search' : 'Close search'
8686

8787
<div
8888
data-search-results
89-
class="absolute left-0 right-0 z-(--z-content-floating) mt-2 hidden overflow-hidden rounded-lg border border-trim bg-content-inverse shadow-elevated"
89+
class="absolute left-0 right-0 z-(--z-content-floating) mt-2 hidden overflow-hidden rounded-lg border border-trim bg-(--color-gray-300) shadow-elevated"
9090
>
9191
<ul data-search-results-list class="divide-y divide-border" aria-label="Search suggestions"></ul>
9292
</div>
@@ -108,7 +108,7 @@ const clearButtonLabel = hasInitialQuery ? 'Clear search' : 'Close search'
108108

109109
<div
110110
data-search-results
111-
class="absolute left-0 right-0 z-(--z-content-floating) mt-2 hidden overflow-hidden rounded-lg border border-trim bg-content-inverse shadow-elevated"
111+
class="absolute left-0 right-0 z-(--z-content-floating) mt-2 hidden overflow-hidden rounded-lg border border-trim bg-(--color-gray-300) shadow-elevated"
112112
>
113113
<ul data-search-results-list class="divide-y divide-border" aria-label="Search suggestions"></ul>
114114
</div>

src/components/Search/SearchBar/index.module.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,11 @@
2121
var(--shadow-elevated, 0 0 0 0 transparent),
2222
inset 0 0 0 2px var(--color-spotlight);
2323
}
24+
25+
.searchBar [data-search-results] {
26+
border-radius: calc(0.5rem + 2px);
27+
}
28+
29+
.searchBar [data-search-results-list] a {
30+
text-decoration: none;
31+
}

src/icons/microphone.svg

Lines changed: 4 additions & 0 deletions
Loading

src/icons/moon.svg

Lines changed: 4 additions & 7 deletions
Loading

src/icons/sun.svg

Lines changed: 4 additions & 3 deletions
Loading

0 commit comments

Comments
 (0)