chore(sfc-playground): hide versions when click iframe & set color-scheme to dark (#6003)

This commit is contained in:
木杉 2022-06-13 10:58:27 +08:00 committed by GitHub
parent bdffc143ef
commit b4e1dfe3f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -82,6 +82,10 @@ function toggleSSR() {
</template> </template>
<style> <style>
.dark {
color-scheme: dark;
}
body { body {
font-size: 13px; font-size: 13px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,

View File

@ -54,6 +54,11 @@ onMounted(async () => {
window.addEventListener('click', () => { window.addEventListener('click', () => {
expanded.value = false expanded.value = false
}) })
window.addEventListener('blur', () => {
if (document.activeElement?.tagName === 'IFRAME') {
expanded.value = false
}
});
}) })
async function fetchVersions(): Promise<string[]> { async function fetchVersions(): Promise<string[]> {