<button type="button" class="btn btn-dark" id="toggleThemeButton">
    <i id="toggleThemeIcon" class="bi bi-sun"></i>
</button>
<script>
    'use strict'
    let i = document.getElementById("toggleThemeIcon").className = "bi bi-sun";
    const storedTheme =  localStorage.getItem('theme');
    if (storedTheme == null) {
        localStorage.setItem("theme", "light");
        document.getElementById("toggleThemeIcon").className = "bi bi-sun-fill";
        setTheme("light"); 
    }
    else if (storedTheme == "dark") {
        localStorage.setItem("theme", "dark");
        document.getElementById("toggleThemeIcon").className = "bi bi-sun";
        setTheme("dark");
    }
    else if (storedTheme == "light") {
        localStorage.setItem("theme", "light");
        document.getElementById("toggleThemeIcon").className = "bi bi-sun-fill";
        setTheme("light");
    }
</script>
