Skip to content

Commit

Permalink
fixed updateURL parameter name
Browse files Browse the repository at this point in the history
  • Loading branch information
novcmbro committed Jun 6, 2024
1 parent 22d9c38 commit b211bc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/theme.js
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ const theme = {
theme.preferred = () => prefersLightTheme.matches ? "light" : "dark"

theme.update = () => {
const updateURL = (element) => theme.name() === "light" ? element.replace("dark", "light") : element.replace("light", "dark")
const updateURL = (url) => theme.name() === "light" ? url.replace("dark", "light") : url.replace("light", "dark")

document.querySelectorAll("[name='favicon']").forEach(favicon => favicon.href = updateURL(favicon.href))
rootElement.classList.toggle("light", theme.name() === "light")

0 comments on commit b211bc5

Please sign in to comment.