fix: add autofocus in search bar and update search result title style (#603)

This commit is contained in:
Sat Naing
2026-01-10 21:27:23 +07:00
committed by GitHub
parent 698295d23d
commit c61a75575d
+4 -1
View File
@@ -45,8 +45,9 @@ const backUrl = SITE.showBackButton ? `${Astro.url.pathname}` : "/";
// Init pagefind ui // Init pagefind ui
const search = new PagefindUI({ const search = new PagefindUI({
element: "#pagefind-search", element: "#pagefind-search",
showSubResults: true, autofocus: true,
showImages: false, showImages: false,
showSubResults: true,
processTerm: function (term: string) { processTerm: function (term: string) {
params.set("q", term); // Update the `q` parameter in the URL params.set("q", term); // Update the `q` parameter in the URL
history.replaceState(history.state, "", "?" + params.toString()); // Push the new URL without reloading history.replaceState(history.state, "", "?" + params.toString()); // Push the new URL without reloading
@@ -119,6 +120,8 @@ const backUrl = SITE.showBackButton ? `${Astro.url.pathname}` : "/";
color: var(--accent); color: var(--accent);
outline-offset: 1px; outline-offset: 1px;
outline-color: var(--accent); outline-color: var(--accent);
text-decoration-style: dashed;
text-underline-offset: 4px;
} }
.pagefind-ui__result-title a:focus-visible, .pagefind-ui__result-title a:focus-visible,