@@ -18,7 +18,7 @@ shikiWrapperClasses computed property.
18
18
-->
19
19
20
20
<template>
21
- <div class="relative text-left cursor-text ">
21
+ <div class="cursor-text text-left relative ">
22
22
<div
23
23
v-if="highlighterInitialized"
24
24
ref="codeEl"
@@ -51,19 +51,19 @@ shikiWrapperClasses computed property.
51
51
52
52
props.class,
53
53
]"
54
- @click="copyOnClick ? () => copyCode() : () => {}"
54
+ @click="copyOnClick && isSupported ? () => copyCode() : () => {}"
55
55
v-html="highlightedCode"
56
56
/>
57
57
<pre
58
58
v-else
59
- class="overflow-scroll border rounded border-gray-100 text-14px leading-24px font-light py-8px "
59
+ class="border rounded font-light border-gray-100 py-8px text-14px leading-24px overflow-scroll "
60
60
:class="[props.class, lineNumbers ? 'pl-56px' : 'pl-8px' ]"
61
61
>{{ code }}</pre>
62
62
<CopyButton
63
63
v-if="copyButton"
64
64
variant="outline"
65
65
tabindex="-1"
66
- class="absolute bottom -8px right -8px"
66
+ class="right -8px bottom -8px absolute "
67
67
:text="code"
68
68
no-icon
69
69
/>
@@ -146,7 +146,7 @@ const highlightedCode = computed(() => {
146
146
147
147
const codeEl: Ref<HTMLElement | null> = ref(null)
148
148
149
- const { copy, copied } = useClipboard()
149
+ const { copy, isSupported } = useClipboard()
150
150
151
151
const copyCode = () => {
152
152
if (codeEl.value) {
@@ -171,12 +171,12 @@ avoid colliding with styles elsewhere in the document.
171
171
$offset: 1.1em;
172
172
173
173
.inline:deep(.shiki) {
174
- @apply py-1 px-2 bg-gray-50 text-gray-500 inline-block;
174
+ @apply bg-gray-50 py-1 px-2 text-gray-500 inline-block;
175
175
}
176
176
177
177
.shiki-wrapper {
178
178
&:deep(.shiki) {
179
- @apply min-w-max border-r-10px border-r-transparent ;
179
+ @apply border-r-transparent min-w-max border-r-10px;
180
180
}
181
181
182
182
&.wrap:deep(.line) {
@@ -191,7 +191,7 @@ $offset: 1.1em;
191
191
192
192
// Keep bg-gray-50 synced with the box-shadows.
193
193
.line::before, .line:first-child::before {
194
- @apply bg-gray-50 text-gray-500 min-w-40px inline-block text-right px-8px mr-16px sticky;
194
+ @apply bg-gray-50 text-right mr-16px min-w-40px px-8px text-gray-500 inline-block sticky;
195
195
left: 0px !important;
196
196
content: counter(step);
197
197
counter-increment: step;
0 commit comments