thedesk/app/js/ui/theme.js
2020-09-09 20:46:52 +09:00

21 lines
492 B
JavaScript

//テーマ適用
function themes(theme) {
if (!theme) {
var theme = localStorage.getItem('customtheme-id')
if (!theme) {
localStorage.setItem('customtheme-id', 'black')
theme = 'black'
}
}
postMessage(['themeCSSRequest', theme + '.thedesktheme'], '*')
var el = document.getElementsByTagName('html')[0]
el.style.backgroundColor = 'var(--bg)'
var font = localStorage.getItem('font')
if(font) {
el.style.fontFamily = font
} else {
el.style.fontFamily = ''
}
}
themes()