Skip to content

Commit 4c08f76

Browse files
fix: adjust problem sample block styles for dark mode
1 parent c84e7bd commit 4c08f76

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

frontend/src/components/Problem.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ function onCopy (content: string) {
5050
{{ t('oj.sample_input') }}
5151
<i v-tooltip.top="t('oj.click_to_copy_code')" class="pi pi-file" style="cursor: pointer" @click="onCopy(problem.in)" />
5252
</h2>
53-
<pre><code>{{ problem.in }}</code></pre>
53+
<pre class="problem-sample-block"><code>{{ problem.in }}</code></pre>
5454
</template>
5555
<template v-if="problem.out?.trim()">
5656
<h2 class="font-semibold">
5757
{{ t('oj.sample_output') }}
5858
<i v-tooltip.top="t('oj.click_to_copy_code')" class="pi pi-file" style="cursor: pointer" @click="onCopy(problem.out)" />
5959
</h2>
60-
<pre><code>{{ problem.out }}</code></pre>
60+
<pre class="problem-sample-block"><code>{{ problem.out }}</code></pre>
6161
</template>
6262
<template v-if="problem.hint?.trim()">
6363
<h2 class="font-semibold">
@@ -82,8 +82,14 @@ h2
8282
.cont
8383
margin-top: 10px
8484
margin-bottom: 20px
85-
pre
85+
.problem-sample-block
8686
padding: 10px
8787
border-radius: 5px
8888
background-color: #ECEFF1
89+
overflow-x: auto
90+
91+
.ptoj-dark .problem-sample-block
92+
color: var(--p-text-color)
93+
background-color: var(--p-content-hover-background)
94+
border: 1px solid var(--p-surface-border)
8995
</style>

0 commit comments

Comments
 (0)