UNPKG

sce-component

Version:

20 lines (15 loc) 332 B
import { ready } from '../utils/dom' export function set (theme) { const currentTheme = current current = theme ready(() => { if (currentTheme) { document.body.classList.remove(current) } document.body.classList.add(theme) }) } export let current if (typeof __THEME !== 'undefined') { set(__THEME) }