Skip to content

Commit 9cb0a15

Browse files
Fix search results corner styling and ensure consistent dark backgrounds
- Add overflow: hidden to prevent corner background artifacts - Improve border-radius consistency between container and anchor elements - Add inline styles to dynamically generated search results for reliable styling - Enhance CSS with !important declarations to override any conflicting styles - Increase spacing between search result items for better visual separation - Use border-radius: inherit to ensure perfect corner alignment This ensures all search results have clean, properly rounded corners with consistent dark backgrounds throughout the entire item area.
1 parent 88fd0f3 commit 9cb0a15

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

layouts/partials/search-modal.html

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,29 @@
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+
1724
.search-item a {
18-
color: #d1d5db;
19-
padding: 0.75rem;
20-
display: block;
21-
border-radius: 0.375rem;
22-
background-color: #374151;
23-
transition: background-color 0.2s;
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;
2432
}
2533

34+
.search-item:hover,
2635
.search-item a:hover,
36+
.search-item[aria-selected],
2737
.search-item[aria-selected] a {
28-
background-color: #4b5563;
29-
color: white;
38+
background-color: #4b5563 !important;
39+
color: white !important;
3040
}
3141

3242
.search-item-title {
@@ -208,8 +218,8 @@
208218
Object.keys(result).forEach((key, index) => {
209219
resultsContainer.insertAdjacentHTML(
210220
'beforeend',
211-
`<dd class="search-item" role="option">
212-
<a href="${result[key].url}">
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;">
213223
<span class="search-item-icon"></span>
214224
<span class="search-item-content">
215225
${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)