fix(theme): allow wrapping feature icons

closes #2923
pull/2937/head
Divyansh Singh 2 years ago
parent b277beb003
commit a1e1267549

@ -25,8 +25,16 @@ defineProps<{
:tag="link ? 'a' : 'div'" :tag="link ? 'a' : 'div'"
> >
<article class="box"> <article class="box">
<div v-if="typeof icon === 'object' && icon.wrap" class="icon">
<VPImage <VPImage
v-if="typeof icon === 'object'" :image="icon"
:alt="icon.alt"
:height="icon.height || 48"
:width="icon.width || 48"
/>
</div>
<VPImage
v-else-if="typeof icon === 'object'"
:image="icon" :image="icon"
:alt="icon.alt" :alt="icon.alt"
:height="icon.height || 48" :height="icon.height || 48"
@ -66,7 +74,7 @@ defineProps<{
height: 100%; height: 100%;
} }
.VPFeature:deep(.VPImage) { .box > :deep(.VPImage) {
margin-bottom: 20px; margin-bottom: 20px;
} }

@ -190,13 +190,20 @@ export namespace DefaultTheme {
export type FeatureIcon = export type FeatureIcon =
| string | string
| { src: string; alt?: string; width?: string; height: string } | {
src: string
alt?: string
width?: string
height?: string
wrap?: boolean
}
| { | {
light: string light: string
dark: string dark: string
alt?: string alt?: string
width?: string width?: string
height: string height?: string
wrap?: boolean
} }
// sidebar ------------------------------------------------------------------- // sidebar -------------------------------------------------------------------

Loading…
Cancel
Save