Skip to content

Commit

Permalink
feat(phind.js) implement dark mode handling
Browse files Browse the repository at this point in the history
  • Loading branch information
seanoliver committed Aug 3, 2023
1 parent 9bfc387 commit 308bcb6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions providers/phind.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,21 @@ class Phind extends Provider {
});
}

// Some providers will have their own dark mode implementation
static handleDarkMode(isDarkMode) {
console.log('🔴 provider toggle', self.name);
// Implement dark or light mode using prodiver-specific code
if (isDarkMode) {
this.getWebview().executeJavaScript(`
document.documentElement.setAttribute('data-theme', 'dark');
`);
} else {
this.getWebview().executeJavaScript(`
document.documentElement.setAttribute('data-theme', 'light');
`);
}
}

static isEnabled() {
return store.get(`${this.webviewId}Enabled`, false);
}
Expand Down

0 comments on commit 308bcb6

Please sign in to comment.