From fb2bbc8059700692d1cdeea6510e3edbd71feced Mon Sep 17 00:00:00 2001 From: jakubabrzy Date: Mon, 18 Sep 2023 17:46:46 +0200 Subject: [PATCH 1/3] search result highlight --- src/css/custom.css | 1 + src/theme/Navbar/Content/index.tsx | 6 +++++- src/theme/Navbar/Content/styles.module.css | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 src/theme/Navbar/Content/styles.module.css diff --git a/src/css/custom.css b/src/css/custom.css index 5aab7356..5ec5b85b 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -23,6 +23,7 @@ html[data-theme="dark"] { --ifm-font-color-base: theme("colors.gray.50"); --ifm-navbar-search-input-placeholder-color: theme("colors.gray.500"); --ifm-card-background-color: theme("colors.blue.900"); + --docsearch-primary-color: theme("colors.blue.900"); } html[data-theme="light"] { diff --git a/src/theme/Navbar/Content/index.tsx b/src/theme/Navbar/Content/index.tsx index 3a13eb1e..b5ce0866 100644 --- a/src/theme/Navbar/Content/index.tsx +++ b/src/theme/Navbar/Content/index.tsx @@ -1,4 +1,6 @@ import React from "react"; +import clsx from "clsx"; + import { useThemeConfig, ErrorCauseBoundary } from "@docusaurus/theme-common"; import { splitNavbarItems } from "@docusaurus/theme-common/internal"; import NavbarItem, { type Props as NavbarItemConfig } from "@theme/NavbarItem"; @@ -7,6 +9,8 @@ import SearchBar from "@theme/SearchBar"; import NavbarMobileSidebarToggle from "@theme/Navbar/MobileSidebar/Toggle"; import NavbarLogo from "@theme/Navbar/Logo"; +import styles from "./styles.module.css"; + function NavbarItems({ items }: { items: NavbarItemConfig[] }) { return ( <> @@ -38,7 +42,7 @@ export default function NavbarContent() { -
+
diff --git a/src/theme/Navbar/Content/styles.module.css b/src/theme/Navbar/Content/styles.module.css new file mode 100644 index 00000000..847d3ab5 --- /dev/null +++ b/src/theme/Navbar/Content/styles.module.css @@ -0,0 +1,3 @@ +.navbarContent { + --ifm-color-primary: theme("colors.brand.700"); +} \ No newline at end of file From b7548f808f710a10a076fb6f0d00a572d69e8077 Mon Sep 17 00:00:00 2001 From: jakubabrzy Date: Tue, 19 Sep 2023 09:14:49 +0200 Subject: [PATCH 2/3] use Tailwind's arbitrary property --- src/theme/Navbar/Content/index.tsx | 6 +----- src/theme/Navbar/Content/styles.module.css | 3 --- 2 files changed, 1 insertion(+), 8 deletions(-) delete mode 100644 src/theme/Navbar/Content/styles.module.css diff --git a/src/theme/Navbar/Content/index.tsx b/src/theme/Navbar/Content/index.tsx index b5ce0866..9dd4afec 100644 --- a/src/theme/Navbar/Content/index.tsx +++ b/src/theme/Navbar/Content/index.tsx @@ -1,6 +1,4 @@ import React from "react"; -import clsx from "clsx"; - import { useThemeConfig, ErrorCauseBoundary } from "@docusaurus/theme-common"; import { splitNavbarItems } from "@docusaurus/theme-common/internal"; import NavbarItem, { type Props as NavbarItemConfig } from "@theme/NavbarItem"; @@ -9,8 +7,6 @@ import SearchBar from "@theme/SearchBar"; import NavbarMobileSidebarToggle from "@theme/Navbar/MobileSidebar/Toggle"; import NavbarLogo from "@theme/Navbar/Logo"; -import styles from "./styles.module.css"; - function NavbarItems({ items }: { items: NavbarItemConfig[] }) { return ( <> @@ -42,7 +38,7 @@ export default function NavbarContent() {
-
+
diff --git a/src/theme/Navbar/Content/styles.module.css b/src/theme/Navbar/Content/styles.module.css deleted file mode 100644 index 847d3ab5..00000000 --- a/src/theme/Navbar/Content/styles.module.css +++ /dev/null @@ -1,3 +0,0 @@ -.navbarContent { - --ifm-color-primary: theme("colors.brand.700"); -} \ No newline at end of file From 684c7d901ed8864dc4fdad4c1d145e8294881b43 Mon Sep 17 00:00:00 2001 From: jakubabrzy Date: Tue, 19 Sep 2023 09:30:14 +0200 Subject: [PATCH 3/3] remove leftover --- src/css/custom.css | 1 - 1 file changed, 1 deletion(-) diff --git a/src/css/custom.css b/src/css/custom.css index 5ec5b85b..5aab7356 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -23,7 +23,6 @@ html[data-theme="dark"] { --ifm-font-color-base: theme("colors.gray.50"); --ifm-navbar-search-input-placeholder-color: theme("colors.gray.500"); --ifm-card-background-color: theme("colors.blue.900"); - --docsearch-primary-color: theme("colors.blue.900"); } html[data-theme="light"] {