Skip to content

Commit

Permalink
clean: clean console.log
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Mar 16, 2022
1 parent 8d22ef2 commit a33181a
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions main.js
Expand Up @@ -106,7 +106,6 @@ class DarkMode extends HTMLElement {
if (name === 'mode' && oldValue !== newValue && [LIGHT, DARK].includes(newValue)) {
const rememberedValue = localStorage.getItem(LOCAL_NANE);
if (this.mode === rememberedValue) {
console.log('rememberedValue:', rememberedValue)
this.mode = newValue;
this._changeContent();
this._changeThemeTag();
Expand All @@ -117,10 +116,6 @@ class DarkMode extends HTMLElement {
} else if ((name === LIGHT || name === DARK) && oldValue !== newValue) {
this._changeContent();
}
if (name === 'permanent') {

console.log('>>>', this.permanent)
}
if (name === 'permanent' && typeof this.permanent === 'boolean') {
this.permanent ? localStorage.setItem(LOCAL_NANE, this.mode) : localStorage.removeItem(LOCAL_NANE);
}
Expand Down Expand Up @@ -178,10 +173,9 @@ class DarkMode extends HTMLElement {
doc.head.appendChild(initstyle);
}

var customStyle = this.getAttribute('style');
var style = doc.createElement('style');
style.textContent = `
.wrapper { cursor: pointer; user-select: none; position: relative; ${customStyle ? customStyle : ''} }
.wrapper { cursor: pointer; user-select: none; position: relative; }
.wrapper > span + span { margin-left: .4rem; }
`;
shadow.appendChild(style);
Expand Down

0 comments on commit a33181a

Please sign in to comment.