refactor: remove theme toggle functionality and related styles
This commit is contained in:
parent
3152e8f72b
commit
981c81a865
4 changed files with 2 additions and 112 deletions
|
|
@ -32,19 +32,6 @@ const {
|
|||
<html lang={locale}>
|
||||
<head>
|
||||
<BaseHead title={title} description={description} image={image} locale={locale} />
|
||||
<script is:inline>
|
||||
(() => {
|
||||
const root = document.documentElement;
|
||||
const stored = localStorage.getItem('theme');
|
||||
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
const theme = stored === 'dark' || stored === 'light' ? stored : prefersDark ? 'dark' : 'light';
|
||||
root.dataset.theme = theme;
|
||||
// Enable theme transitions after initial render
|
||||
requestAnimationFrame(() =>
|
||||
requestAnimationFrame(() => root.setAttribute('data-theme-ready', '')),
|
||||
);
|
||||
})();
|
||||
</script>
|
||||
<slot name="head" />
|
||||
</head>
|
||||
<body class={bodyClass}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue