diff --git a/_includes/default_head_tags.html b/_includes/default_head_tags.html index 205dca1..3cabff8 100644 --- a/_includes/default_head_tags.html +++ b/_includes/default_head_tags.html @@ -14,7 +14,10 @@ - + + + + diff --git a/assets/js/pre_page_load.js b/assets/js/pre_page_load.js index 3fbbba4..0b1c4b8 100644 --- a/assets/js/pre_page_load.js +++ b/assets/js/pre_page_load.js @@ -14,6 +14,8 @@ const getCSSCustomProp = (propKey) => { return response; }; +const themeColor = document.querySelectorAll('meta[name="theme-color"]'); + const applySetting = () => { let currentSetting = localStorage.getItem(STORAGE_KEY) || getCSSCustomProp(COLOR_MODE_KEY); @@ -23,10 +25,19 @@ const applySetting = () => { "data-user-color-scheme", currentSetting ); + switch (currentSetting) { + case "light": + console.log("setting theme colour to #fcfcfc"); + themeColor.forEach((n) => n.setAttribute("content", "#fcfcfc")); + break; + case "dark": + themeColor.forEach((n) => n.setAttribute("content", "#222")); + break; + } } - console.log( - `Mode Preference set on document.documentElement.getAttribute("data-user-color-scheme"): ${currentSetting}` - ); + // console.log( + // `Mode Preference set on document.documentElement.getAttribute("data-user-color-scheme"): ${currentSetting}` + // ); }; let localStorageSetting = localStorage.getItem(STORAGE_KEY); diff --git a/badge.html b/badge.html index 1af210a..a46c0af 100644 --- a/badge.html +++ b/badge.html @@ -12,10 +12,20 @@ img: {% include default_head_tags.html %}