diff --git a/assets/js/theme.js b/assets/js/theme.js index d5a324b..37a59de 100644 --- a/assets/js/theme.js +++ b/assets/js/theme.js @@ -3,6 +3,7 @@ const getTheme = window.localStorage && window.localStorage.getItem("theme"); const themeToggle = document.querySelector(".theme-toggle"); const isDark = getTheme === "dark"; +var metaThemeColor = document.querySelector("meta[name=theme-color]"); if (getTheme !== null) { document.body.classList.toggle("dark-theme", isDark); @@ -15,4 +16,7 @@ themeToggle.addEventListener("click", () => { "theme", document.body.classList.contains("dark-theme") ? "dark" : "light", ); + document.body.classList.contains("dark-theme") ? + metaThemeColor.setAttribute("content", "#252627") : metaThemeColor.setAttribute("content", "#fafafa"); + ; }); diff --git a/layouts/partials/favicons.html b/layouts/partials/favicons.html index b454691..d3366ba 100644 --- a/layouts/partials/favicons.html +++ b/layouts/partials/favicons.html @@ -2,6 +2,6 @@ - + - \ No newline at end of file + \ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html index bcab312..c7eae1f 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,31 +1,35 @@ - - - - - + + + + + {{ block "title" . }} -