thedesk/app/js/ui/theme.js

21 lines
492 B
JavaScript
Raw Normal View History

2018-01-28 23:22:43 +11:00
//テーマ適用
function themes(theme) {
if (!theme) {
2020-09-09 00:35:30 +10:00
var theme = localStorage.getItem('customtheme-id')
2019-05-19 17:39:30 +10:00
if (!theme) {
2020-09-09 00:35:30 +10:00
localStorage.setItem('customtheme-id', 'black')
2020-09-09 21:46:52 +10:00
theme = 'black'
2018-03-13 04:41:38 +11:00
}
2018-01-28 23:22:43 +11:00
}
2020-09-09 00:35:30 +10:00
postMessage(['themeCSSRequest', theme + '.thedesktheme'], '*')
2019-12-20 11:52:57 +11:00
var el = document.getElementsByTagName('html')[0]
el.style.backgroundColor = 'var(--bg)'
2020-09-09 21:46:52 +10:00
var font = localStorage.getItem('font')
if(font) {
el.style.fontFamily = font
} else {
el.style.fontFamily = ''
}
2018-01-28 23:22:43 +11:00
}
2019-12-20 11:52:57 +11:00
themes()