Skip to content

Commit 746dcf8

Browse files
author
sky.sun
committed
feat: 移动端优化
1 parent d803e1b commit 746dcf8

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

docs/.vitepress/components/InteractiveCode.vue

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="interactive-code border-gray-200 dark:border-gray-700 my-4">
3-
<div class="border border-gray-200 dark:border-gray-700 rounded-t-lg overflow-hidden sticky top-[64px] z-10">
3+
<div class="interactive-code-header border border-gray-200 dark:border-gray-700 rounded-t-lg overflow-hidden sticky z-10">
44
<div class="px-4 py-2 flex justify-between items-center text-xs font-semibold bg-gray-50 dark:bg-[#1e1e1e]"
55
:class="[colorTheme.text]">
66
<span class="text-sm">{{ computedTitle }}</span>
@@ -369,4 +369,20 @@ onUnmounted((): void => {
369369
.readonly-code :deep(.cm-cursor) {
370370
display: none !important;
371371
}
372+
373+
.interactive-code-header {
374+
top: 47px;
375+
}
376+
377+
@media (min-width: 960px) {
378+
.interactive-code-header {
379+
top: 111px;
380+
}
381+
}
382+
383+
@media (min-width: 1280px) {
384+
.interactive-code-header {
385+
top: 64px;
386+
}
387+
}
372388
</style>

0 commit comments

Comments
 (0)