Skip to content

Commit 8494928

Browse files
committed
chore(devtools): migrate to shiki
1 parent 1506dc3 commit 8494928

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

client/components/OCodeBlock.vue

+4-15
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<script setup lang="ts">
2-
import type { Lang } from 'shiki-es'
2+
import type { BundledLanguage } from 'shiki'
33
import { computed } from 'vue'
44
import { renderCodeHighlight } from '../composables/shiki'
55
66
const props = withDefaults(
77
defineProps<{
88
code: string
9-
lang?: Lang
9+
lang?: BundledLanguage
1010
lines?: boolean
1111
transformRendered?: (code: string) => string
1212
}>(),
1313
{
14-
lines: true,
14+
lines: false,
1515
},
1616
)
1717
const rendered = computed(() => {
@@ -29,18 +29,7 @@ const rendered = computed(() => {
2929
</template>
3030

3131
<style>
32-
.n-code-block-lines .shiki code {
33-
counter-reset: step;
34-
counter-increment: step calc(var(--start, 1) - 1);
35-
}
3632
.n-code-block-lines .shiki code .line::before {
37-
content: counter(step);
38-
counter-increment: step;
39-
width: 2rem;
40-
padding-right: 0.5rem;
41-
margin-right: 0.5rem;
42-
display: inline-block;
43-
text-align: right;
44-
--at-apply: text-truegray:50;
33+
display: none;
4534
}
4635
</style>

0 commit comments

Comments
 (0)