Skip to content

Commit d133592

Browse files
Render Font Awesome icons in <ClientOnly> mode
Signed-off-by: Anatoli Nicolae <an@thundersquared.com>
1 parent ffcfb9d commit d133592

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@apiscp/vitepress-theme",
3-
"version": "1.0.5",
3+
"version": "1.0.6",
44
"description": "The VitePress theme for notes.apiscp.com.",
55
"main": "src/index.ts",
66
"exports": {

src/components/Callouts/Callout.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ const icon = computed(() => icons[props.level])
2121

2222
<template>
2323
<div :class="['callout', level]">
24-
<div class="callout-icon" v-if="level">
25-
<FontAwesomeIcon :icon="icon"></FontAwesomeIcon>
26-
</div>
24+
<ClientOnly>
25+
<div class="callout-icon" v-if="level">
26+
<FontAwesomeIcon :icon="icon"></FontAwesomeIcon>
27+
</div>
28+
</ClientOnly>
2729
<div class="callout-body">
2830
<h3 class="callout-title" v-if="props.title">{{ props.title }}</h3>
2931
<slot></slot>
@@ -61,11 +63,11 @@ const icon = computed(() => icons[props.level])
6163
line-height: 1.75rem;
6264
}
6365
64-
.callout .callout-body > p:first-of-type {
66+
.callout .callout-body>p:first-of-type {
6567
margin-top: 0;
6668
}
6769
68-
.callout .callout-body > p:last-of-type {
70+
.callout .callout-body>p:last-of-type {
6971
margin-bottom: 0;
7072
}
7173

src/components/Card.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ const tag = computed(() => props.href ? 'a' : 'div')
1515

1616
<template>
1717
<component :is="tag" class="card" :class="{ link: props.href }" :href="props.href || undefined">
18-
<div v-if="props.icon" class="card-icon">
19-
<FontAwesomeIcon :icon="props.icon"></FontAwesomeIcon>
20-
</div>
18+
<ClientOnly>
19+
<div v-if="props.icon" class="card-icon">
20+
<FontAwesomeIcon :icon="props.icon"></FontAwesomeIcon>
21+
</div>
22+
</ClientOnly>
2123
<h3 class="card-title">{{ props.title }}</h3>
2224
<div class="card-body">
2325
<slot></slot>
@@ -45,11 +47,11 @@ const tag = computed(() => props.href ? 'a' : 'div')
4547
height: 1.25rem;
4648
}
4749
48-
.card .card-body > p:first-of-type {
50+
.card .card-body>p:first-of-type {
4951
margin-top: 0;
5052
}
5153
52-
.card .card-body > p:last-of-type {
54+
.card .card-body>p:last-of-type {
5355
margin-bottom: 0;
5456
}
5557

0 commit comments

Comments
 (0)