Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): fix ShikiMiniPlayground style #833

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion docs/.vitepress/components/LanguagesList.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { computed, ref } from 'vue'
import { computed, ref, watch } from 'vue'
import { usePlayground } from '../store/playground'

const play = usePlayground()
Expand All @@ -17,6 +17,14 @@ const langs = computed(() => {
return play.bundledLangsWeb
return play.bundledLangsFull
})
watch(showModel, () => {
if (showModel.value) {
(document.scrollingElement as HTMLElement).style.overflow = 'hidden'
}
else {
(document.scrollingElement as HTMLElement).style.overflow = 'initial'
}
})
</script>

<template>
Expand Down
12 changes: 4 additions & 8 deletions docs/.vitepress/components/ShikiMiniPlayground.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ function onInput() {

<template>
<div
class="language-ts vp-adaptive-theme mini-playground transition-none!" shadow
class="language-ts vp-adaptive-theme transition-none! mini-playground" shadow
:style="[play.preStyle, { colorScheme: currentThemeType }]"
>
<div absolute z-10 p2 px3 pl5 flex="~ gap-1 items-center" left-0 top-0 right-0 border="b-solid gray/5">
<div sticky z-12 p2 px3 pl5 flex="~ gap-1 items-center" left-0 top-0 right-0 border="b-solid gray/5" bg-inherit>
<div i-carbon:chevron-down op50 />
<select v-model="play.lang" font-mono :style="play.preStyle">
<option v-for="lang in play.allLanguages" :key="lang.id" :value="lang.id">
Expand Down Expand Up @@ -62,7 +62,7 @@ function onInput() {
<div i-carbon:shuffle op50 />
</button>
</div>
<div relative mt-10 min-h-100>
<div relative min-h-100 float-left min-w-full>
<span ref="highlightContainerRef" v-html="play.output" />
<textarea
ref="textAreaRef"
Expand All @@ -80,15 +80,11 @@ function onInput() {
</template>

<style>
.mini-playground {
overflow: hidden;
}

.mini-playground select {
background: transparent;
color: inherit;
min-width: 8em;
padding: 0 !important;
padding: 0px !important;
position: relative;
}
.mini-playground select:focus {
Expand Down
Loading