mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 20:41:09 +02:00
🌙 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:
parent
fc0ed636fc
commit
4c1beb9534
1 changed files with 13 additions and 0 deletions
|
|
@ -93,6 +93,19 @@ export default defineConfig({
|
|||
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 }),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue