Skip to content

Commit a1e1267

Browse files
committed
fix(theme): allow wrapping feature icons
closes #2923
1 parent b277beb commit a1e1267

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

Diff for: src/client/theme-default/components/VPFeature.vue

+10-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,16 @@ defineProps<{
2525
:tag="link ? 'a' : 'div'"
2626
>
2727
<article class="box">
28+
<div v-if="typeof icon === 'object' && icon.wrap" class="icon">
29+
<VPImage
30+
:image="icon"
31+
:alt="icon.alt"
32+
:height="icon.height || 48"
33+
:width="icon.width || 48"
34+
/>
35+
</div>
2836
<VPImage
29-
v-if="typeof icon === 'object'"
37+
v-else-if="typeof icon === 'object'"
3038
:image="icon"
3139
:alt="icon.alt"
3240
:height="icon.height || 48"
@@ -66,7 +74,7 @@ defineProps<{
6674
height: 100%;
6775
}
6876
69-
.VPFeature:deep(.VPImage) {
77+
.box > :deep(.VPImage) {
7078
margin-bottom: 20px;
7179
}
7280

Diff for: types/default-theme.d.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,20 @@ export namespace DefaultTheme {
190190

191191
export type FeatureIcon =
192192
| string
193-
| { src: string; alt?: string; width?: string; height: string }
193+
| {
194+
src: string
195+
alt?: string
196+
width?: string
197+
height?: string
198+
wrap?: boolean
199+
}
194200
| {
195201
light: string
196202
dark: string
197203
alt?: string
198204
width?: string
199-
height: string
205+
height?: string
206+
wrap?: boolean
200207
}
201208

202209
// sidebar -------------------------------------------------------------------

0 commit comments

Comments
 (0)