Skip to content

Commit

Permalink
chore(sfc-playground): hide versions when click iframe & set color-sc…
Browse files Browse the repository at this point in the history
…heme to dark (#6003)
  • Loading branch information
zhmushan committed Jun 13, 2022
1 parent bdffc14 commit b4e1dfe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/sfc-playground/src/App.vue
Expand Up @@ -82,6 +82,10 @@ function toggleSSR() {
</template>

<style>
.dark {
color-scheme: dark;
}
body {
font-size: 13px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
Expand Down
5 changes: 5 additions & 0 deletions packages/sfc-playground/src/Header.vue
Expand Up @@ -54,6 +54,11 @@ onMounted(async () => {
window.addEventListener('click', () => {
expanded.value = false
})
window.addEventListener('blur', () => {
if (document.activeElement?.tagName === 'IFRAME') {
expanded.value = false
}
});
})
async function fetchVersions(): Promise<string[]> {
Expand Down

0 comments on commit b4e1dfe

Please sign in to comment.