From 4c1beb95346ce4c829affca22840c1be6b92fa2b Mon Sep 17 00:00:00 2001 From: Till-JS <101404291+Till-JS@users.noreply.github.com> Date: Thu, 29 Jan 2026 18:22:23 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=99=20feat(docs):=20set=20dark=20mode?= =?UTF-8?q?=20as=20default=20theme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add script to head config that sets dark mode when user hasn't chosen a theme preference. --- apps/docs/astro.config.mjs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apps/docs/astro.config.mjs b/apps/docs/astro.config.mjs index bc41fb657..9171d07cc 100644 --- a/apps/docs/astro.config.mjs +++ b/apps/docs/astro.config.mjs @@ -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 }),