]> git.wh0rd.org Git - chrome-ext/web-power-switch.git/blob - theme-init.js
add dark/light themes
[chrome-ext/web-power-switch.git] / theme-init.js
1 // Written by Mike Frysinger <vapier@gmail.com>.  Released into the public domain.
2
3 // Load the theme override asap to help with initial loading/flashing.
4 chrome.storage.sync.get(['theme'], ({theme}) => {
5         if (theme == 'light' || theme == 'dark') {
6                 const css = document.querySelector('link#theme-override');
7                 css.href = `css/${theme}.css`;
8         }
9 });