9 lines
308 B
TypeScript
Raw Normal View History

export const changeAccentColor = (color: string) => {
document.body.setAttribute('data-accent-color', color)
}
const stateString = localStorage.getItem('state')
2022-04-29 19:16:34 +08:00
const stateInLocalStorage = stateString ? JSON.parse(stateString) : {}
2022-04-29 19:16:34 +08:00
changeAccentColor(stateInLocalStorage?.settings?.accentColor || 'blue')