diff --git a/layouts/partials/user-profile.html b/layouts/partials/user-profile.html index add5ddb..6cdd368 100644 --- a/layouts/partials/user-profile.html +++ b/layouts/partials/user-profile.html @@ -108,7 +108,10 @@

Organizations

{{ if .Site.Params.github}} - @github + + + + {{ end }} @@ -190,4 +193,14 @@ window.onscroll = function (e) { document.querySelector('#headerStuck').classList.remove('is-stuck'); } }; +var style = localStorage.getItem('data-color-mode'); +iconElement = document.getElementById('github-icon'); +if (style == 'light') { + iconElement.setAttribute('fill', '#24292e'); + iconElement.setAttribute('class', 'Header-link'); +} +else { + iconElement.removeAttribute('fill'); + iconElement.setAttribute('class', 'octicon Header-link'); +} diff --git a/static/js/theme-mode.js b/static/js/theme-mode.js index 58b58a1..c1f9bab 100644 --- a/static/js/theme-mode.js +++ b/static/js/theme-mode.js @@ -1,11 +1,16 @@ function switchTheme() { const currentStyle = currentTheme(); + var iconElement = document.getElementById('github-icon'); if (currentStyle == 'light') { setTheme('dark'); + iconElement.removeAttribute('fill'); + iconElement.setAttribute('class', 'octicon Header-link'); } else { setTheme('light'); + iconElement.setAttribute('fill', '#24292e'); + iconElement.setAttribute('class', 'Header-link'); } } @@ -25,4 +30,4 @@ function currentTheme() { (() => { setTheme(currentTheme()); -})(); \ No newline at end of file +})();