Skip to content

Commit f322736

Browse files
committed
Works now
1 parent 52bb0d8 commit f322736

1 file changed

Lines changed: 12 additions & 15 deletions

File tree

app/components/Readme.vue

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,23 +62,20 @@ function handleClick(event: MouseEvent) {
6262
<article
6363
class="readme prose prose-invert max-w-[70ch] lg:max-w-none px-1"
6464
v-html="html"
65-
:data-i18n-note="$t('package.readme.callout.note')"
66-
:data-i18n-tip="$t('package.readme.callout.tip')"
67-
:data-i18n-important="$t('package.readme.callout.important')"
68-
:data-i18n-warning="$t('package.readme.callout.warning')"
69-
:data-i18n-caution="$t('package.readme.callout.caution')"
65+
:style="{
66+
'--i18n-note': '\'' + $t('package.readme.callout.note') + '\'',
67+
'--i18n-tip': '\'' + $t('package.readme.callout.tip') + '\'',
68+
'--i18n-important': '\'' + $t('package.readme.callout.important') + '\'',
69+
'--i18n-warning': '\'' + $t('package.readme.callout.warning') + '\'',
70+
'--i18n-caution': '\'' + $t('package.readme.callout.caution') + '\'',
71+
}"
7072
@click="handleClick"
7173
/>
7274
</template>
7375

7476
<style scoped>
7577
/* README prose styling */
7678
.readme {
77-
--i18n-note: attr(data-i18n-note);
78-
--i18n-tip: attr(data-i18n-tip);
79-
--i18n-important: attr(data-i18n-important);
80-
--i18n-warning: attr(data-i18n-warning);
81-
--i18n-caution: attr(data-i18n-caution);
8279
color: var(--fg-muted);
8380
line-height: 1.75;
8481
/* Prevent horizontal overflow on mobile */
@@ -343,7 +340,7 @@ function handleClick(event: MouseEvent) {
343340
background: rgba(59, 130, 246, 0.05);
344341
}
345342
.readme :deep(blockquote[data-callout='note']::before) {
346-
content: var(--i18n-note);
343+
content: var(--i18n-note, 'Note');
347344
color: #3b82f6;
348345
}
349346
.readme :deep(blockquote[data-callout='note']::after) {
@@ -358,7 +355,7 @@ function handleClick(event: MouseEvent) {
358355
background: rgba(34, 197, 94, 0.05);
359356
}
360357
.readme :deep(blockquote[data-callout='tip']::before) {
361-
content: var(--i18n-tip);
358+
content: var(--i18n-tip, 'Tip');
362359
color: #22c55e;
363360
}
364361
.readme :deep(blockquote[data-callout='tip']::after) {
@@ -373,7 +370,7 @@ function handleClick(event: MouseEvent) {
373370
background: rgba(168, 85, 247, 0.05);
374371
}
375372
.readme :deep(blockquote[data-callout='important']::before) {
376-
content: var(--i18n-important);
373+
content: var(--i18n-important, 'Important');
377374
color: var(--syntax-fn);
378375
}
379376
.readme :deep(blockquote[data-callout='important']::after) {
@@ -388,7 +385,7 @@ function handleClick(event: MouseEvent) {
388385
background: rgba(234, 179, 8, 0.05);
389386
}
390387
.readme :deep(blockquote[data-callout='warning']::before) {
391-
content: var(--i18n-warning);
388+
content: var(--i18n-warning, 'Warning');
392389
color: #eab308;
393390
}
394391
.readme :deep(blockquote[data-callout='warning']::after) {
@@ -403,7 +400,7 @@ function handleClick(event: MouseEvent) {
403400
background: rgba(239, 68, 68, 0.05);
404401
}
405402
.readme :deep(blockquote[data-callout='caution']::before) {
406-
content: var(--i18n-caution);
403+
content: var(--i18n-caution, 'Caution');
407404
color: #ef4444;
408405
}
409406
.readme :deep(blockquote[data-callout='caution']::after) {

0 commit comments

Comments
 (0)