🌙 feat(docs): set dark mode as default theme

Add script to head config that sets dark mode when user hasn't
chosen a theme preference.
This commit is contained in:
Till-JS 2026-01-29 18:22:23 +01:00
parent fc0ed636fc
commit 4c1beb9534

View file

@ -93,6 +93,19 @@ export default defineConfig({
content: 'https://docs.manacore.app/og-image.png', content: 'https://docs.manacore.app/og-image.png',
}, },
}, },
{
tag: 'script',
content: `
// Set dark mode as default
(function() {
const stored = localStorage.getItem('starlight-theme');
if (!stored) {
document.documentElement.dataset.theme = 'dark';
localStorage.setItem('starlight-theme', 'dark');
}
})();
`,
},
], ],
}), }),
tailwind({ applyBaseStyles: false }), tailwind({ applyBaseStyles: false }),