From b1f2a989a51ee56de3a415b2ba495451749d98d9 Mon Sep 17 00:00:00 2001 From: David Monaghan Date: Tue, 4 Feb 2025 05:58:05 -0500 Subject: [PATCH] www: docs: feat: add dark mode (#2820) - Added CSS vars for dark/light colors. - Added dark/light theme toggle as Island Fixes #2648 --------- Co-authored-by: Marvin Hagemeister --- www/components/DocsSidebar.tsx | 4 +- www/components/Footer.tsx | 9 ++- www/components/Header.tsx | 12 ++-- www/components/NavigationBar.tsx | 13 ++++- www/islands/CopyArea.tsx | 4 +- www/islands/TableOfContents.tsx | 6 +- www/islands/ThemeToggle.tsx | 62 +++++++++++++++++++++ www/islands/VersionSelect.tsx | 6 +- www/routes/_app.tsx | 4 +- www/routes/docs/[...slug].tsx | 18 +++--- www/routes/docs/_layout.tsx | 11 ++++ www/routes/showcase-bak.tsx | 95 ++++++++++++++++++++++++++++++++ www/static/docsearch.css | 2 +- www/static/markdown.css | 59 +++++++++++++++----- www/static/styles.css | 46 ++++++++++++++++ www/tailwind.config.ts | 15 ++++- 16 files changed, 320 insertions(+), 46 deletions(-) create mode 100644 www/islands/ThemeToggle.tsx create mode 100644 www/routes/docs/_layout.tsx create mode 100644 www/routes/showcase-bak.tsx diff --git a/www/components/DocsSidebar.tsx b/www/components/DocsSidebar.tsx index fc5afa7b..f2fc8472 100644 --- a/www/components/DocsSidebar.tsx +++ b/www/components/DocsSidebar.tsx @@ -12,7 +12,7 @@ export function SidebarCategory(props: {
  • {title} @@ -36,7 +36,7 @@ export function SidebarEntry(props: {
  • {title} diff --git a/www/components/Footer.tsx b/www/components/Footer.tsx index ab3aa323..d73c2910 100644 --- a/www/components/Footer.tsx +++ b/www/components/Footer.tsx @@ -18,16 +18,19 @@ const LINKS = [ export default function Footer(props: JSX.HTMLAttributes) { return (