Possibility to invert button (Show the mode that it will take you to if clicked)
Closed this issue · 2 comments
LucGzy commented
If this is also something that you would be interested in i have a simple implementation :
The import :
<script type="module">
window.buttonMode = "inverted";
import "/src/main.ts";
</script>
define global in window.d.ts :
interface Window {
buttonMode: string;
}
Modify setSwitcherIcon:
switcher.innerHTML =
window.buttonMode === "inverted"
? mode === DARK
? lightIcon
: darkIcon
: mode === DARK
? darkIcon
: lightIcon;
Modify initializeSwitcher:
switcher.style.backgroundColor = window.buttonMode === "inverted" ? "black" : "white";
switcher.style.color = window.buttonMode === "inverted" ? "white" : "black";
I have the code ready for pull request if interested. cheers
bufferhead-code commented
Added with #7