Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Custom Starlight components in `src/components/` override defaults: `Head.astro`
## Styling Notes

- Theme uses rounded corners (`--radius: 0.5rem`)
- Dark mode is default; light mode uses violet accent (hue 285), dark uses teal/green (hue ~145)
- Light mode is default; light mode uses violet accent (hue 285), dark uses teal/green (hue ~145)
- Tailwind v4 custom variant: `@custom-variant dark (&:is(.dark *, [data-theme="dark"] *))`
- Tables are auto-styled via rehype plugin with `data-slot` attributes for CSS targeting

Expand Down
6 changes: 3 additions & 3 deletions src/components/ThemeProvider.astro
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
// Custom ThemeProvider that defaults to dark instead of system preference
// Custom ThemeProvider that defaults to light instead of system preference
---

{/* This is intentionally inlined to avoid FOUC. */}
<script is:inline>
window.StarlightThemeProvider = (() => {
const storedTheme =
typeof localStorage !== 'undefined' ? localStorage.getItem('starlight-theme') : null;
// null = never set any preference → default to dark
// null = never set any preference → default to light
// '' (empty string) = user chose 'auto' → use system preference
// 'light'/'dark' = user chose explicitly
let theme;
if (storedTheme === null) {
theme = 'dark';
theme = 'light';
} else if (storedTheme === '') {
theme = window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/components/react/ThemeSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function getTheme(): Theme {
return stored === '' ? 'auto' : stored;
}
}
return 'dark';
return 'light';
}

function setTheme(theme: Theme) {
Expand Down
Loading