feat: enable dark theme and theme switcher
Some checks failed
Node.js CI / Lint and Test (push) Successful in 1m26s
Code Analysis / SonarQube (push) Failing after 1m29s

This commit is contained in:
2025-03-27 14:51:14 -07:00
parent bd47ff2bb3
commit db7a34e975
5 changed files with 475 additions and 3 deletions

View File

@ -2,17 +2,18 @@ import { defineConfig } from 'astro/config';
import starlight from "@astrojs/starlight";
import { ExpressiveCodeTheme } from "@astrojs/starlight/expressive-code"
import themeJson from "./src/styles/theme.json"
import darkThemeJson from "./src/styles/theme-dark.json"
import { navigation } from "./src/components/navigation.ts";
const sakuraDreams = ExpressiveCodeTheme.fromJSONString(JSON.stringify(themeJson));
const sakuraDreamsDark = ExpressiveCodeTheme.fromJSONString(JSON.stringify(darkThemeJson));
export default defineConfig({
site: "https://docs.nhcarrigan.com",
integrations: [starlight({
components: {
Footer: "./src/components/Footer.astro",
ThemeSelect: "./src/components/ThemeSelect.astro",
ThemeProvider: "./src/components/ThemeProvider.astro",
},
title: "NHCarrigan Docs",
@ -69,7 +70,7 @@ export default defineConfig({
"./src/fonts/font-face.css"
],
expressiveCode: {
themes: [sakuraDreams]
themes: [sakuraDreams, sakuraDreamsDark],
}
}),
]