From 5757f451eef5743a22f377784a71810f03359ad7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 6 Jul 2025 06:07:35 +0000 Subject: [PATCH 1/3] Initial plan From 5cd508d6849d7d2673c9a67c6474966fef78c312 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 6 Jul 2025 06:27:52 +0000 Subject: [PATCH 2/3] Fix dark mode consistency and set as default theme Co-authored-by: sanjay-kv <30715153+sanjay-kv@users.noreply.github.com> --- docusaurus.config.ts | 6 ++++++ src/css/custom.css | 49 ++++++++++++++++++++++++++++++++++++++++++++ src/theme/Root.tsx | 32 +++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+) diff --git a/docusaurus.config.ts b/docusaurus.config.ts index ea8a059..c5a726e 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -72,6 +72,12 @@ const config: Config = { ], themeConfig: { + // Set dark mode as default and ensure preferences persist + colorMode: { + defaultMode: 'dark', + disableSwitch: false, + respectPrefersColorScheme: false, + }, image: "img/docusaurus-social-card.jpg", navbar: { title: "Recode Hive", diff --git a/src/css/custom.css b/src/css/custom.css index dc3ef31..0ca2720 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -28,6 +28,27 @@ --ifm-color-primary-lighter: #32d8b4; --ifm-color-primary-lightest: #4fddbf; --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); + + /* Ensure consistent dark background and text colors */ + --ifm-background-color: #1b1b1d; + --ifm-background-surface-color: #242526; + --ifm-color-content: #e3e3e3; + --ifm-color-content-secondary: rgba(255, 255, 255, 0.8); + + /* Navigation and UI elements */ + --ifm-navbar-background-color: #242526; + --ifm-footer-background-color: #242526; + --ifm-menu-color-background-active: rgba(255, 255, 255, 0.05); + --ifm-menu-color-background-hover: rgba(255, 255, 255, 0.03); + + /* Code blocks */ + --ifm-code-background: #2d2d30; + --ifm-pre-background: #2d2d30; + --ifm-blockquote-background-color: rgba(255, 255, 255, 0.05); + + /* Links and interactive elements */ + --ifm-link-color: #4fb3e1; + --ifm-link-hover-color: #25c2a0; } @@ -155,4 +176,32 @@ -webkit-background-clip: text; -webkit-text-fill-color: transparent; color: transparent; +} + +/* Ensure Tailwind dark class is synced with Docusaurus theme */ +[data-theme='dark'] { + color-scheme: dark; +} + +[data-theme='light'] { + color-scheme: light; +} + +/* Additional dark mode consistency fixes */ +[data-theme='dark'] .navbar__logo img { + filter: brightness(1.2); +} + +[data-theme='dark'] .footer { + --ifm-footer-background-color: var(--ifm-background-surface-color); +} + +/* Ensure dropdown menus work well in dark mode */ +[data-theme='dark'] .dropdown__menu { + background-color: var(--ifm-background-surface-color); + border: 1px solid var(--ifm-color-emphasis-300); +} + +[data-theme='dark'] .dropdown__link:hover { + background-color: var(--ifm-menu-color-background-hover); } \ No newline at end of file diff --git a/src/theme/Root.tsx b/src/theme/Root.tsx index 9ab5a6f..f55c9de 100644 --- a/src/theme/Root.tsx +++ b/src/theme/Root.tsx @@ -5,6 +5,38 @@ import { Analytics } from '@vercel/analytics/react'; export default function Root({children}) { return ( <> + {/* Script to prevent flash of light theme on initial load */} +