Skip to content

Commit 46c16aa

Browse files
committed
style: optimize layout
1 parent 7621387 commit 46c16aa

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

apps/web/src/components/CodemirrorEditor/CssEditor.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ function tabChanged(tabName: string | number) {
135135
'fixed top-0 right-0 w-full h-full z-100 bg-background border-l shadow-lg': store.isMobile,
136136
'animate': store.isMobile && enableAnimation,
137137
// 桌面端样式
138-
'border-l-2 flex-1 order-2 border-gray/50': !store.isMobile,
138+
'border-l-2 flex-1 order-2 border-gray/50 min-w-0': !store.isMobile,
139139
}"
140140
:style="{
141141
transform: store.isMobile ? (displayStore.isShowCssEditor ? 'translateX(0)' : 'translateX(100%)') : 'none',

apps/web/src/components/CodemirrorEditor/RightSlider.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const formatOptions = ref<Format[]>([`rgb`, `hex`, `hsl`, `hsv`])
7272
'animate': store.isMobile && enableAnimation,
7373
// 桌面端样式
7474
'border-l-2 order-2 border-gray/20 bg-white transition-width duration-300 dark:bg-[#191919]': !store.isMobile,
75-
'w-100': !store.isMobile && store.isOpenRightSlider,
75+
'flex-1': !store.isMobile && store.isOpenRightSlider,
7676
'w-0 border-l-0': !store.isMobile && !store.isOpenRightSlider,
7777
}"
7878
:style="{

apps/web/src/views/CodemirrorEditor.vue

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ onUnmounted(() => {
486486
<ResizablePanelGroup direction="horizontal">
487487
<ResizablePanel
488488
:default-size="15"
489-
:max-size="store.isOpenPostSlider ? 30 : 0"
489+
:max-size="store.isOpenPostSlider ? 20 : 0"
490490
:min-size="store.isOpenPostSlider ? 10 : 0"
491491
>
492492
<PostSlider />
@@ -525,16 +525,19 @@ onUnmounted(() => {
525525
<div
526526
id="preview"
527527
ref="previewRef"
528-
class="preview-wrapper w-full p-5"
528+
class="preview-wrapper w-full p-5 flex justify-center"
529529
>
530530
<div
531531
id="output-wrapper"
532-
class="w-full"
532+
class="w-full max-w-full"
533533
:class="{ output_night: !backLight }"
534534
>
535535
<div
536-
class="preview border-x shadow-xl"
537-
:class="[store.isMobile ? 'w-[100%]' : store.previewWidth]"
536+
class="preview border-x shadow-xl mx-auto"
537+
:class="[
538+
store.isMobile ? 'w-full' : store.previewWidth,
539+
store.previewWidth === 'w-[375px]' ? 'max-w-full' : '',
540+
]"
538541
>
539542
<section id="output" class="w-full" v-html="output" />
540543
<div v-if="isCoping" class="loading-mask">

0 commit comments

Comments
 (0)