Skip to content

Commit 06ddff2

Browse files
authored
Merge pull request #478 from Sma1lboy/feat-adding-border-active-highlight-color
feat: add active border highlight for search bar input
2 parents 1a4af21 + 0c1a816 commit 06ddff2

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ This theme is shipped with polished styles just like the Algolia Search on the D
151151
| --search-local-muted-color | `#969faf` | `var(--ifm-color-secondary-darkest)` |
152152
| --search-local-icon-stroke-width | `1.4` | - |
153153
| --search-local-hit-active-color | `var(--ifm-color-white)` | - |
154+
| --search-local-input-active-border-color | `var(--ifm-color-primary)` | - |
154155

155156
E.g.:
156157

docusaurus-search-local/src/client/theme/SearchBar/SearchBar.module.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
padding: var(--search-local-spacing, 12px);
1717
}
1818

19+
.searchInput:focus {
20+
outline: 2px solid var(--search-local-input-active-border-color, var(--ifm-color-primary));
21+
outline-offset: 0px;
22+
}
23+
1924
@media not (max-width: 996px) {
2025
.searchBar.searchBarLeft .dropdownMenu {
2126
left: 0 !important;

docusaurus-search-local/src/client/theme/SearchBar/SearchBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,14 +432,14 @@ export default function SearchBar({
432432
// Manually make the search bar be LTR even if in RTL
433433
dir="ltr"
434434
>
435-
<input
435+
<input
436436
placeholder={translate({
437437
id: "theme.SearchBar.label",
438438
message: "Search",
439439
description: "The ARIA label and placeholder for search button",
440440
})}
441441
aria-label="Search"
442-
className="navbar__search-input"
442+
className={`navbar__search-input ${styles.searchInput}`}
443443
onMouseEnter={onInputMouseEnter}
444444
onFocus={onInputFocus}
445445
onBlur={onInputBlur}

0 commit comments

Comments
 (0)