feat: implement theme toggle switch

This commit is contained in:
Stevan Freeborn
2023-04-20 23:36:52 -05:00
parent 8eb224e018
commit 88d4c1c339
10 changed files with 138 additions and 70 deletions
+6 -3
View File
@@ -97,7 +97,7 @@ export default function SideBar({
return (
<div className={styles.container}>
<div>
<div className={styles.titleContainer}>
<Link href="/" className={styles.link}>
<h1 className={styles.title}>
<span className={styles.onspring}>
@@ -106,14 +106,17 @@ export default function SideBar({
<span className={styles.api}>API</span>
</h1>
</Link>
<label className="switch">
<label className={styles.switch}>
<input
title="Toggle dark mode"
onChange={() =>
setTheme(theme === 'light' ? 'dark' : 'light')
}
type="checkbox"
/>
<span className="slider round"></span>
<span
className={`${styles.slider} ${styles.round}`}
></span>
</label>
</div>
<ListTree docs={version.docs} />