style: improve docs branding and header

This commit is contained in:
2026-08-01 11:01:27 +02:00
parent 230aced2c1
commit 951f91686e
8 changed files with 103 additions and 5 deletions
+20
View File
@@ -0,0 +1,20 @@
<script is:inline>
(() => {
const preference = window.matchMedia('(prefers-color-scheme: dark)');
const applySystemTheme = () => {
const theme = preference.matches ? 'dark' : 'light';
document.documentElement.dataset.theme = theme;
document.documentElement.style.colorScheme = theme;
};
try {
localStorage.removeItem('starlight-theme');
} catch {
// The system preference still works when storage is unavailable.
}
applySystemTheme();
preference.addEventListener?.('change', applySystemTheme);
})();
</script>