mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-21 01:02:59 +08:00
11 lines
255 B
JavaScript
11 lines
255 B
JavaScript
;(() => {
|
|
const saved = localStorage.getItem('el-theme-appearance')
|
|
if (
|
|
saved === 'auto'
|
|
? window.matchMedia(`(prefers-color-scheme: dark)`).matches
|
|
: saved === 'dark'
|
|
) {
|
|
document.documentElement.classList.add('dark')
|
|
}
|
|
})()
|