Add ThemeToggle component

This commit is contained in:
thiloho
2023-05-18 20:20:43 +02:00
parent 21437ae15d
commit 40411fd328
11 changed files with 139 additions and 9 deletions

View File

@@ -11,4 +11,8 @@ const { title, description } = Astro.props;
<title>{title}</title>
<meta name="author" content="Your Name" />
<meta name="description" content={description} />
<script is:inline>
const storedTheme = localStorage.getItem("theme");
document.documentElement.classList = storedTheme;
</script>
</head>