Skip to content

Commit 80db98e

Browse files
groksrcclaude
andcommitted
Add dark mode support to navigation and layout components
- Fix sidebar navigation colors and hover states for dark mode - Update table of contents styling with proper dark mode text colors - Improve search component border colors using CSS variables - Add dark mode text colors to layout descriptions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent c2c11cf commit 80db98e

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

src/components/Search.astro

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
font-size: 1rem !important;
7777
background: hsl(var(--background)) !important;
7878
background-color: hsl(var(--background)) !important;
79-
border: 2px solid hsl(214.3 31.8% 91.4%) !important;
79+
border: 2px solid hsl(var(--border)) !important;
8080
border-radius: 0.375rem !important;
8181
outline: none !important;
8282
transition: border-color 0.2s !important;
@@ -90,11 +90,6 @@
9090
box-shadow: none !important;
9191
}
9292

93-
/* Dark mode border color */
94-
.dark .pagefind-custom .pagefind-ui__search-input {
95-
border-color: hsl(217.2 32.6% 17.5%) !important;
96-
}
97-
9893
.pagefind-custom .pagefind-ui__search-input::placeholder {
9994
color: hsl(var(--muted-foreground));
10095
}
@@ -139,6 +134,11 @@
139134
margin-left: 0;
140135
line-height: 1.4;
141136
}
137+
138+
.pagefind-custom .pagefind-ui__result-title a {
139+
color: hsl(var(--muted-foreground));
140+
text-decoration: none;
141+
}
142142

143143
/* Style nested result titles */
144144
.pagefind-custom .pagefind-ui__result-nested .pagefind-ui__result-title {

src/components/Sidebar.astro

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ const currentPath = Astro.url.pathname
1515
href={link.href}
1616
target={link.external ? "_blank" : undefined}
1717
rel={link.external ? "noopener noreferrer" : undefined}
18-
class="flex items-center gap-3 px-3 py-1.5 text-sm text-gray-500 hover:text-gray-900 transition-colors no-underline group"
18+
class="flex items-center gap-3 px-3 py-1.5 text-sm text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 transition-colors no-underline group"
1919
style="text-decoration: none"
2020
>
2121
{link.icon && (
22-
<div class="flex items-center justify-center w-6 h-6 rounded-md border border-gray-200 group-hover:bg-black group-hover:border-black transition-all">
23-
<Icon name={link.icon} class="w-4 h-4 text-gray-400 group-hover:text-white" />
22+
<div class="flex items-center justify-center w-6 h-6 rounded-md border border-gray-200 dark:border-gray-700 group-hover:bg-black dark:group-hover:bg-white group-hover:border-black dark:group-hover:border-white transition-all">
23+
<Icon name={link.icon} class="w-4 h-4 text-gray-400 dark:text-gray-500 group-hover:text-white dark:group-hover:text-black" />
2424
</div>
2525
)}
2626
<span>{link.title}</span>
@@ -31,18 +31,18 @@ const currentPath = Astro.url.pathname
3131
<!-- Regular navigation sections -->
3232
{navConfig.sidebar.map((section) => (
3333
<div>
34-
<h4 class="text-sm font-medium leading-none tracking-tight text-gray-900 px-3 mb-4 mt-10">
34+
<h4 class="text-sm font-medium leading-none tracking-tight text-gray-900 dark:text-gray-100 px-3 mb-4 mt-10">
3535
{section.title}
3636
</h4>
3737
<ul class="space-y-1 list-none m-0 p-0">
3838
{section.items.map((item) => (
3939
<li>
4040
<a
4141
href={item.href}
42-
class={`block text-sm transition-colors hover:text-gray-900 rounded-xl ${
42+
class={`block text-sm transition-colors hover:text-gray-900 dark:hover:text-gray-100 rounded-xl ${
4343
currentPath === item.href
44-
? 'text-gray-900 font-medium bg-[#e8e8e8] px-3.5 py-2'
45-
: 'text-gray-600 font-normal hover:bg-gray-50 px-3 py-1.5'
44+
? 'text-gray-900 dark:text-gray-100 font-medium bg-[#e8e8e8] dark:bg-gray-800 px-3.5 py-2'
45+
: 'text-gray-600 dark:text-gray-400 font-normal hover:bg-gray-50 dark:hover:bg-gray-800/50 px-3 py-1.5'
4646
}`}
4747
style="text-decoration: none"
4848
>

src/components/TableOfContents.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<aside class="hidden xl:block w-64 flex-shrink-0">
77
<div class="sticky top-20 h-[calc(100vh-5rem)] overflow-y-auto py-6 pl-6">
88
<div class="space-y-3">
9-
<div class="flex items-center gap-2 text-sm font-medium text-gray-900">
9+
<div class="flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-gray-100">
1010
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1111
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 10h16M4 14h16M4 18h16"></path>
1212
</svg>
@@ -57,8 +57,8 @@
5757
const a = document.createElement('a');
5858
a.href = `#${id}`;
5959
a.className = level === 3
60-
? 'block py-1 pl-4 text-sm text-gray-500 hover:text-gray-900 transition-colors font-normal'
61-
: 'block py-1 text-gray-600 hover:text-gray-900 transition-colors';
60+
? 'block py-1 pl-4 text-sm text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 transition-colors font-normal'
61+
: 'block py-1 text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 transition-colors';
6262
a.style.textDecoration = 'none';
6363
a.textContent = title;
6464

src/layouts/DocsLayout.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const { title, description } = Astro.props.frontmatter || Astro.props
2525
<Breadcrumb />
2626
<h1>{title}</h1>
2727
{description && (
28-
<p class="text-lg text-gray-600 mt-2 mb-8">{description}</p>
28+
<p class="text-lg text-gray-600 dark:text-gray-400 mt-2 mb-8">{description}</p>
2929
)}
3030
<slot />
3131
</article>

0 commit comments

Comments
 (0)