Skip to content

Commit c61bcf5

Browse files
committed
fix(pre): overflow-x-scroll and the padding-right
1 parent c3eadff commit c61bcf5

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

app/components/Comment/Reply.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
</div>
2727

2828
<MDC
29-
v-if="preview"
29+
v-if="preview && form.message"
3030
:value="form.message"
3131
class="mt-2 border border-amber rounded-lg border-solid p-2 shadow"
3232
/>

app/components/global/ProsePre.vue

+8-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
{{ $props.language ?? 'text' }}
55
</span>
66
<pre :class="$props.class">
7-
<slot />
7+
<div class="flex-1 px-3">
8+
<slot />
9+
</div>
810
</pre>
911
</div>
1012
</template>
@@ -50,17 +52,18 @@ watchEffect(() => {
5052
pre {
5153
font-size: 14px;
5254
background-color: white;
53-
padding: 10px;
5455
border-radius: 6px;
5556
margin-top: 1em;
5657
overflow-x: auto;
58+
display: flex;
59+
flex-direction: column;
60+
flex-wrap: wrap;
5761
}
5862
5963
pre code {
6064
display: block;
61-
margin-top: -1em;
62-
margin-bottom: -2em;
6365
white-space: pre;
66+
margin: -2em 0;
6467
}
6568
6669
pre code .line {
@@ -82,6 +85,6 @@ pre code .line {
8285
}
8386
8487
.copy-btn:hover {
85-
opacity: 1 !important;
88+
opacity: 1;
8689
}
8790
</style>

0 commit comments

Comments
 (0)