diff --git a/src/components/blocks/navBar.astro b/src/components/blocks/navBar.astro index 344984f..677cec8 100644 --- a/src/components/blocks/navBar.astro +++ b/src/components/blocks/navBar.astro @@ -1,10 +1,11 @@ --- import VerticalNav from "./verticalNav.astro"; import SearchModal from "../ui/SearchModal.astro"; +import ThemeToggle from "../ui/ThemeToggle.astro"; ---
-
@@ -99,6 +103,34 @@ import SearchModal from "../ui/SearchModal.astro"; ); } + .site-nav { + background: var(--nav-background); + color: var(--text-color); + border-bottom: 1px solid color-mix(in srgb, var(--border-color) 55%, transparent); + } + + .site-nav .sidebar { + background: var(--sidebar-background); + } + + .site-nav a { + color: var(--text-color); + } + + .site-nav .nav-link:hover { + background: var(--control-hover); + } + + html[data-theme="light"] { + --pagefind-ui-primary: #171717; + --pagefind-ui-text: #171717; + --pagefind-ui-background: #ffffff; + --pagefind-ui-border: #cbd5e1; + --pagefind-ui-tag: #171717; + --foreground: #171717; + --background: #171717; + } + .hamburger-menu { --x-width: calc(var(--hamburger-height) * 1.41421356237); diff --git a/src/components/ui/HeroTitle.astro b/src/components/ui/HeroTitle.astro index f0b298d..fb96cce 100644 --- a/src/components/ui/HeroTitle.astro +++ b/src/components/ui/HeroTitle.astro @@ -1,6 +1,6 @@
- Getting started with + Getting started with
+ + diff --git a/src/components/ui/ThemeToggle.astro b/src/components/ui/ThemeToggle.astro new file mode 100644 index 0000000..0c58071 --- /dev/null +++ b/src/components/ui/ThemeToggle.astro @@ -0,0 +1,115 @@ + + + + + diff --git a/src/components/ui/card-hover-effect.tsx b/src/components/ui/card-hover-effect.tsx index 52551d0..46c895b 100644 --- a/src/components/ui/card-hover-effect.tsx +++ b/src/components/ui/card-hover-effect.tsx @@ -67,7 +67,7 @@ export const Card = ({ return (
@@ -87,7 +87,7 @@ export const CardTitle = ({ return (

@@ -105,7 +105,7 @@ export const CardDescription = ({ return (

diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 053f844..8d8c976 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -11,7 +11,7 @@ const { title, description } = Astro.props; --- - + @@ -48,6 +48,34 @@ const { title, description } = Astro.props; + @@ -74,8 +102,8 @@ const { title, description } = Astro.props; html { font-family: system-ui, sans-serif; - background-color: #171717; - color: rgb(255 255 255); + background-color: var(--background-color); + color: var(--text-color); } html, diff --git a/src/styles/global.css b/src/styles/global.css index 27624d8..7d6a21a 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -1,5 +1,55 @@ @import "tailwindcss"; +:root, +html[data-theme="dark"] { + --background-color: #171717; + --surface-color: #202020; + --nav-background: rgb(23 23 23 / 0.82); + --sidebar-background: #151515; + --control-background: #101010; + --control-hover: #2f2f2f; + --text-color: #ffffff; + --muted-text: #9ca3af; + --border-color: #505050; + --card-background: #232323; + --card-border: rgb(255 255 255 / 0.2); + --card-border-hover: #334155; +} + +html[data-theme="light"] { + --background-color: #f8fafc; + --surface-color: #ffffff; + --nav-background: rgb(255 255 255 / 0.86); + --sidebar-background: #f8fafc; + --control-background: #ffffff; + --control-hover: #e2e8f0; + --text-color: #171717; + --muted-text: #4b5563; + --border-color: #cbd5e1; + --card-background: #ffffff; + --card-border: #cbd5e1; + --card-border-hover: #94a3b8; +} + +html, +body { + transition: + background-color 180ms ease, + color 180ms ease; +} + +html[data-theme="light"] .text-white { + color: var(--text-color); +} + +html[data-theme="light"] .text-gray-400 { + color: var(--muted-text); +} + +html[data-theme="light"] .guide-content code { + background-color: #e2e8f0; +} + @theme { --color-primary: #fafafa; --color-secondary: #171717;