Skip to content

Commit

Permalink
fix(theme): allow wrapping feature icons
Browse files Browse the repository at this point in the history
closes #2923
  • Loading branch information
brc-dd committed Sep 10, 2023
1 parent b277beb commit a1e1267
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
12 changes: 10 additions & 2 deletions src/client/theme-default/components/VPFeature.vue
Expand Up @@ -25,8 +25,16 @@ defineProps<{
:tag="link ? 'a' : 'div'"
>
<article class="box">
<div v-if="typeof icon === 'object' && icon.wrap" class="icon">
<VPImage
:image="icon"
:alt="icon.alt"
:height="icon.height || 48"
:width="icon.width || 48"
/>
</div>
<VPImage
v-if="typeof icon === 'object'"
v-else-if="typeof icon === 'object'"
:image="icon"
:alt="icon.alt"
:height="icon.height || 48"
Expand Down Expand Up @@ -66,7 +74,7 @@ defineProps<{
height: 100%;
}
.VPFeature:deep(.VPImage) {
.box > :deep(.VPImage) {
margin-bottom: 20px;
}
Expand Down
11 changes: 9 additions & 2 deletions types/default-theme.d.ts
Expand Up @@ -190,13 +190,20 @@ export namespace DefaultTheme {

export type FeatureIcon =
| string
| { src: string; alt?: string; width?: string; height: string }
| {
src: string
alt?: string
width?: string
height?: string
wrap?: boolean
}
| {
light: string
dark: string
alt?: string
width?: string
height: string
height?: string
wrap?: boolean
}

// sidebar -------------------------------------------------------------------
Expand Down

0 comments on commit a1e1267

Please sign in to comment.