workflow: fix sfc playground persist light mode (#5999)
This commit is contained in:
parent
109751abdd
commit
7487d50775
@ -9,10 +9,10 @@
|
|||||||
<script>
|
<script>
|
||||||
// process shim for old versions of @vue/compiler-sfc dependency
|
// process shim for old versions of @vue/compiler-sfc dependency
|
||||||
window.process = { env: {} }
|
window.process = { env: {} }
|
||||||
const saved = localStorage.getItem('vue-sfc-playground-prefer-dark')
|
const savedPreferDark = localStorage.getItem('vue-sfc-playground-prefer-dark')
|
||||||
if (
|
if (
|
||||||
saved !== 'false' ||
|
savedPreferDark === 'true' ||
|
||||||
window.matchMedia('(prefers-color-scheme: dark)').matches
|
(!savedPreferDark && window.matchMedia('(prefers-color-scheme: dark)').matches)
|
||||||
) {
|
) {
|
||||||
document.documentElement.classList.add('dark')
|
document.documentElement.classList.add('dark')
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user