feat: remove theme toggle
This commit is contained in:
parent
7e2c35da70
commit
29abad4fe9
@ -11,7 +11,6 @@
|
||||
<header>
|
||||
<section>
|
||||
<h1>mBank MT940 konwerter</h1>
|
||||
<button id="theme-toggle" type="button"></button>
|
||||
</section>
|
||||
</header>
|
||||
<main>
|
||||
|
@ -2,12 +2,6 @@
|
||||
--pico-font-family: "Atkinson Hyperlegible", sans-serif;
|
||||
}
|
||||
|
||||
/* use to enforce styles for both themes */
|
||||
[data-theme="dark"],
|
||||
:not([data-theme="dark"]) {
|
||||
--noop: none;
|
||||
}
|
||||
|
||||
section {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
@ -42,21 +36,6 @@ header section {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#theme-toggle {
|
||||
width: auto;
|
||||
background: none;
|
||||
border: none;
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
#theme-toggle::before {
|
||||
content: "☀️";
|
||||
}
|
||||
|
||||
#theme-toggle[dark]::before {
|
||||
content: "🌙";
|
||||
}
|
||||
|
||||
#icd-logo {
|
||||
height: 50px;
|
||||
aspect-ratio: 1200/319;
|
||||
|
@ -45,19 +45,3 @@ async function handle() {
|
||||
|
||||
document.querySelector("#submit")?.addEventListener("click", handle);
|
||||
console.log("added handler to", document.querySelector("#submit"));
|
||||
|
||||
async function toggleTheme() {
|
||||
const html = document.documentElement;
|
||||
const toggle = document.getElementById("theme-toggle")!;
|
||||
const theme = html.getAttribute("data-theme");
|
||||
if (theme === "dark") {
|
||||
html.removeAttribute("data-theme");
|
||||
toggle.removeAttribute("dark");
|
||||
} else {
|
||||
html.setAttribute("data-theme", "dark");
|
||||
toggle.setAttribute("dark", "");
|
||||
}
|
||||
}
|
||||
|
||||
document.querySelector("#theme-toggle")?.addEventListener("click", toggleTheme);
|
||||
console.log("added handler to", document.querySelector("#theme-toggle"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user