#5 💄 Added Darkmode JS for dialog

This commit is contained in:
David Huh 2021-10-13 11:57:50 +00:00
parent 5a7978fced
commit ab4454afed

View File

@ -95,6 +95,13 @@ const toggleDarkMode = () => {
navElement.classList.toggle("nav--dark-mode"); navElement.classList.toggle("nav--dark-mode");
submitButton.classList.toggle("submitButton--dark-mode"); submitButton.classList.toggle("submitButton--dark-mode");
/* Dialog */
let modalContents = document.getElementsByClassName('modal-toggle')
for (content of modalContents) {
content.classList.toggle("modal--dark-mode")
}
if (colorModeToggleIcon.classList.contains("fa-moon")) { if (colorModeToggleIcon.classList.contains("fa-moon")) {
colorModeToggleIcon.classList.remove("fa-moon"); colorModeToggleIcon.classList.remove("fa-moon");
colorModeToggleIcon.classList.add("fa-sun"); colorModeToggleIcon.classList.add("fa-sun");