Skip to content

Commit 1e285d4

Browse files
fix: improve search modal performance and styling
- Remove expensive blur filter that delayed modal rendering - Hide noise background when search modal is active - Fix search bar layout by replacing broken grid with flexbox - Hide search placeholder text visually (sr-only) - Center magnifier icon vertically
1 parent d315d14 commit 1e285d4

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

docs/assets/css/docsearch.css

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,16 @@ input[type="search"]::-webkit-search-results-decoration {
1616
}
1717

1818
body.DocSearch--active::before {
19+
display: none;
20+
}
21+
body.DocSearch--active::after {
1922
z-index: 99;
2023
content: "";
2124
position: fixed;
22-
top: -10px;
23-
left: -10px;
24-
right: -10px;
25-
bottom: -10px;
25+
inset: 0;
2626
background-color: rgba(0, 0, 0, 0.5);
2727
}
2828

29-
body.DocSearch--active > *:not(.DocSearch-Container) {
30-
filter: blur(5px);
31-
}
32-
3329
.DocSearch-NoResults {
3430
display: flex;
3531
flex-wrap: wrap;
@@ -74,6 +70,9 @@ button.DocSearch-Button {
7470
@apply flex flex-grow gap-2 text-slate-400 items-center;
7571
@apply dark:text-purple-500;
7672
}
73+
.DocSearch-Button-Placeholder {
74+
@apply sr-only;
75+
}
7776
.DocSearch-Button-Keys {
7877
@apply text-sm px-2 text-slate-400 border rounded space-x-1;
7978
@apply dark:text-purple-400 dark:border-purple-500;
@@ -144,6 +143,12 @@ button.DocSearch-Button {
144143
padding: 0.75em 1em;
145144
border-radius: 0.5em;
146145
}
146+
.DocSearch-MagnifierLabel {
147+
@apply text-[0px] flex items-center;
148+
}
149+
.DocSearch-MagnifierLabel svg {
150+
@apply w-5 h-5;
151+
}
147152

148153
.DocSearch-SearchBar form input {
149154
appearance: none;

docs/assets/css/main.css

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,15 @@ html.dark body::before {
4949
}
5050

5151
.DocSearch-SearchBar {
52-
@apply grid grid-cols-[minmax(0,1fr)_auto];
52+
@apply flex items-center;
5353
}
5454

5555
.DocSearch-SearchBar form {
56-
@apply grid grid-cols-[auto_0_minmax(0,1fr)_auto];
56+
@apply flex flex-1 items-center gap-2;
57+
}
58+
59+
.DocSearch-SearchBar form input {
60+
@apply flex-1;
5761
}
5862

5963
.monaco-editor,

0 commit comments

Comments
 (0)