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 <marvin@deno.com>
This commit is contained in:
David Monaghan
2025-02-04 11:58:05 +01:00
committed by GitHub
co-authored by Marvin Hagemeister
parent adf8b87a03
commit b1f2a989a5
16 changed files with 320 additions and 46 deletions
+3 -3
View File
@@ -105,7 +105,7 @@ export function TableOfContents({ headings }: TableOfContentsProps) {
<button
id="toc-outline-btn"
onClick={() => setIsOpen((v) => !v)}
class="bg-gray-100 py-2 px-4 rounded border border-gray-300 flex items-center hover:border-green-600 transition-colors text-sm"
class="bg-background-primary py-2 px-4 rounded border border-foreground-secondary/30 flex items-center hover:border-fresh-green/80 transition-colors text-sm"
>
On this page
<svg
@@ -117,7 +117,7 @@ export function TableOfContents({ headings }: TableOfContentsProps) {
</svg>
</button>
{isOpen && (
<div class="mt-2 pl-4 border-l border-gray-250 text-[13px] leading-7">
<div class="mt-2 pl-4 border-l border-foreground-primary/20 text-[13px] leading-7">
<nav aria-labelledby="toc-outline-btn">
<ul>
{headings.map((heading) => {
@@ -142,7 +142,7 @@ export function TableOfContents({ headings }: TableOfContentsProps) {
ref={refMarker}
class="marker w-[2px] bg-green-400 h-5 absolute top-0 opacity-0 transition-all"
/>
<div class="pl-4 border-l border-gray-250 text-[13px] leading-7">
<div class="pl-4 border-l border-foreground-secondary/20 text-[13px] leading-7">
<div role="heading" aria-level={2} class="font-semibold">
On this page
</div>