mirror of
https://github.com/MeiK2333/github-style.git
synced 2025-10-07 10:04:04 +00:00
@@ -1,18 +1,22 @@
|
||||
function switchTheme() {
|
||||
const currentStyle = currentTheme();
|
||||
var iconElement = document.getElementById('github-icon');
|
||||
const iconElement = document.getElementById('github-icon');
|
||||
|
||||
if (currentStyle == 'light') {
|
||||
if (currentStyle === 'light') {
|
||||
setTheme('dark');
|
||||
if (iconElement) {
|
||||
iconElement.setAttribute('class', 'octicon');
|
||||
iconElement.setAttribute('color', '#f0f6fc');
|
||||
}
|
||||
}
|
||||
else {
|
||||
setTheme('light');
|
||||
if (iconElement) {
|
||||
iconElement.removeAttribute('color');
|
||||
iconElement.removeAttribute('class');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setTheme(style) {
|
||||
document.querySelectorAll('.isInitialToggle').forEach(elem => {
|
||||
|
Reference in New Issue
Block a user