]> git.wh0rd.org - chrome-ext/tabs-backup.git/blame - theme-init.js
add dark mode support
[chrome-ext/tabs-backup.git] / theme-init.js
CommitLineData
68553004
MF
1// Load the theme override asap to help with initial loading/flashing.
2function switchTheme(theme) {
3 const css = document.querySelector('link#theme-override');
4 if (theme == 'light' || theme == 'dark') {
5 css.href = `${theme}.css`;
6 } else {
7 css.href = '';
8 }
9}
10
11switchTheme(localStorage.prefsTheme);