Skip to content

Commit

Permalink
use current starlight theme
Browse files Browse the repository at this point in the history
  • Loading branch information
SaraVieira committed May 17, 2024
1 parent ed56e8b commit 35473b3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/docs/src/components/Search.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@
import { RegisterSearchBox, RegisterSearchButton } from "@orama/searchbox";
import "@orama/searchbox/dist/index.css";
import { getOramaDB } from "../../plugins/client";

try {
const client = await getOramaDB("docs");
RegisterSearchBox({
oramaInstance: client,
backdrop: true,
colorScheme: "system",
colorScheme: localStorage.getItem("starlight-theme") || "system",
resultsMap: {
description: "content",
},
setResultTitle: (doc) => doc.title.split("| Orama Docs")[0],
});

RegisterSearchButton({ colorScheme: "system" });
RegisterSearchButton({
colorScheme: localStorage.getItem("starlight-theme") || "system",
});
} catch (error) {
console.log(error);
}
Expand Down

0 comments on commit 35473b3

Please sign in to comment.