Skip to content

Commit 683c2bb

Browse files
Fix search results styling by updating main CSS file
- Update search-item styles in assets/css/index.css to use dark theme colors - Change search item backgrounds from white to gray-700 for dark theme - Update text colors from dark to light gray for proper contrast - Change hover and selected states to use gray-600 with white text - Remove redundant CSS and inline styles from search modal - Clean up JavaScript to use standard HTML without inline styling This fixes the issue where only the first search result had proper dark styling by addressing the root CSS rules instead of trying to override them.
1 parent 9cb0a15 commit 683c2bb

File tree

2 files changed

+5
-28
lines changed

2 files changed

+5
-28
lines changed

assets/css/index.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,16 +240,16 @@ select {
240240
}
241241

242242
.search-item {
243-
@apply bg-white rounded-md relative text-redis-ink-900 border border-redis-pen-800;
243+
@apply bg-gray-700 rounded-md relative text-gray-300 border border-gray-600;
244244
}
245245

246246
.search-item[aria-selected] {
247-
@apply bg-red-100;
247+
@apply bg-gray-600;
248248
}
249249

250250
.search-item:hover,
251251
.search-item:not([aria-selected]):focus-within {
252-
@apply bg-red-50 text-redis-pen-800;
252+
@apply bg-gray-600 text-white;
253253
}
254254

255255
.search-item > a {

layouts/partials/search-modal.html

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,7 @@
1414
color: #9ca3af;
1515
}
1616

17-
.search-item {
18-
background-color: #374151 !important;
19-
border-radius: 0.5rem !important;
20-
margin-bottom: 0.5rem !important;
21-
overflow: hidden !important;
22-
}
23-
24-
.search-item a {
25-
color: #d1d5db !important;
26-
padding: 0.75rem !important;
27-
display: block !important;
28-
background-color: #374151 !important;
29-
transition: background-color 0.2s !important;
30-
text-decoration: none !important;
31-
border-radius: inherit !important;
32-
}
3317

34-
.search-item:hover,
35-
.search-item a:hover,
36-
.search-item[aria-selected],
37-
.search-item[aria-selected] a {
38-
background-color: #4b5563 !important;
39-
color: white !important;
40-
}
4118

4219
.search-item-title {
4320
font-weight: 500;
@@ -218,8 +195,8 @@
218195
Object.keys(result).forEach((key, index) => {
219196
resultsContainer.insertAdjacentHTML(
220197
'beforeend',
221-
`<dd class="search-item" role="option" style="background-color: #374151; border-radius: 0.5rem; margin-bottom: 0.5rem; overflow: hidden;">
222-
<a href="${result[key].url}" style="color: #d1d5db; padding: 0.75rem; display: block; background-color: #374151; text-decoration: none; border-radius: inherit;">
198+
`<dd class="search-item" role="option">
199+
<a href="${result[key].url}">
223200
<span class="search-item-icon"></span>
224201
<span class="search-item-content">
225202
${result[key].path && result[key].product ? `<div class="search-item-container"><span class="search-item-path">${result[key].path}</span><span class="px-2">→</span><span class="search-item-path">${result[key].product}</span></div>` : ''}

0 commit comments

Comments
 (0)