Dark mode fixed.
This commit is contained in:
parent
3fb372a2b0
commit
7c19c6e72e
1 changed files with 5 additions and 5 deletions
|
@ -18,15 +18,15 @@
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
// Select button
|
// Select button
|
||||||
const btn = document.querySelector(".theme-toggle");
|
const btn = document.querySelector(".theme-toggle");
|
||||||
// Select the stylesheet <link>
|
|
||||||
const theme = document.querySelector("#theme-link");
|
|
||||||
|
|
||||||
// Listen for a click on the button
|
// Listen for a click on the button
|
||||||
btn.addEventListener("click", function() {
|
btn.addEventListener("click", function() {
|
||||||
if (theme.getAttribute("href") == "{{ url_for('static',filename='css/screen-light.css')}}") {
|
// Select the stylesheet <link>
|
||||||
theme.href = "{{ url_for('static',filename='css/screen-dark.css')}}";
|
var theme = document.querySelector("#theme-link");
|
||||||
|
if (theme.getAttribute("href") == "/static/css/screen-light.css") {
|
||||||
|
theme.href = "/static/css/screen-dark.css";
|
||||||
} else {
|
} else {
|
||||||
theme.href = "{{ url_for('static',filename='css/screen-light.css')}}";
|
theme.href = "/static/css/screen-light.css";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue