squash and nuke dev
This commit is contained in:
parent
b2d43ad425
commit
f26e76c114
93 changed files with 33827 additions and 7831 deletions
50
src/components/ThemeToggle.astro
Normal file
50
src/components/ThemeToggle.astro
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
---
|
||||
import { Icon } from "astro-icon/components";
|
||||
---
|
||||
|
||||
<label
|
||||
class="theme-toggle icon-button standard"
|
||||
title="Toggle theme"
|
||||
for="theme-manual-toggle"
|
||||
>
|
||||
<Icon
|
||||
name="moon"
|
||||
class="light-icon"
|
||||
style="width: 24px; height: 24px;"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<Icon
|
||||
name="sun"
|
||||
class="dark-icon"
|
||||
style="width: 24px; height: 24px;"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<div class="state-layer"></div>
|
||||
</label>
|
||||
|
||||
<style>
|
||||
.theme-toggle {
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.light-icon {
|
||||
display: block;
|
||||
}
|
||||
.dark-icon {
|
||||
display: none;
|
||||
}
|
||||
|
||||
:global(html:has(input#theme-manual-toggle:checked)) .light-icon {
|
||||
display: none;
|
||||
}
|
||||
|
||||
:global(html:has(input#theme-manual-toggle:checked)) .dark-icon {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.theme-toggle:focus-within {
|
||||
outline: 2px solid var(--accent-600);
|
||||
border-radius: 50%;
|
||||
}
|
||||
</style>
|
||||
Loading…
Add table
Add a link
Reference in a new issue