mirror of
https://github.com/MeiK2333/github-style.git
synced 2025-10-07 01:54:06 +00:00
添加Github图标动态跟随显示模式
This commit is contained in:
@@ -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());
|
||||
})();
|
||||
})();
|
||||
|
Reference in New Issue
Block a user