Skip to content

Commit

Permalink
workflow: fix sfc playground persist light mode (#5999)
Browse files Browse the repository at this point in the history
  • Loading branch information
phanan authored May 25, 2022
1 parent 109751a commit 7487d50
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/sfc-playground/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
<script>
// process shim for old versions of @vue/compiler-sfc dependency
window.process = { env: {} }
const saved = localStorage.getItem('vue-sfc-playground-prefer-dark')
const savedPreferDark = localStorage.getItem('vue-sfc-playground-prefer-dark')
if (
saved !== 'false' ||
window.matchMedia('(prefers-color-scheme: dark)').matches
savedPreferDark === 'true' ||
(!savedPreferDark && window.matchMedia('(prefers-color-scheme: dark)').matches)
) {
document.documentElement.classList.add('dark')
}
Expand Down

0 comments on commit 7487d50

Please sign in to comment.