Skip to content

Commit 26ba616

Browse files
committed
feat: iconClass prop to NqCard component
1 parent 397fcb6 commit 26ba616

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/nimiq-vitepress-theme/src/components/NqCard.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ import { computed } from 'vue'
77
export type CardColor = 'green' | 'blue' | 'red' | 'gold' | 'orange'
88
export interface NqCardProps {
99
icon?: string
10+
iconClass?: string
1011
bgColor?: CardColor
1112
href?: string
1213
title?: string
1314
description?: string
1415
label?: string
1516
}
1617
17-
const { bgColor, icon, href } = defineProps<NqCardProps>()
18+
const { bgColor, icon, href, iconClass } = defineProps<NqCardProps>()
1819
1920
const hasLink = computed(() => !!href)
2021
@@ -34,7 +35,7 @@ const colors: Partial<Record<CardColor, string>> = { blue: '#0E65C9', green: '#1
3435
{ 'children:max-w-[max(50%,240px)]': bgColor },
3536
]"
3637
>
37-
<div v-if="icon" :class="icon" f-size="~ max-160 min-120" absolute right--12 :style="`color: ${colors[bgColor!]}`" />
38+
<div v-if="icon" :class="`${icon} ${iconClass}`" f-size="~ max-160 min-120" absolute right--12 :style="`color: ${colors[bgColor!]}`" />
3839
<span nq-label text-12 mb-4 text="neutral-700 data-inverted:white/50" data-inverted:mb-8>{{ label }}</span>
3940
<h2 font-semibold f-text="xl data-inverted:2xl" data-inverted:text-white>
4041
{{ title }}

packages/nimiq-vitepress-theme/src/components/NqGrid.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function getSpan({ span, bgColor }: NqCardInGrid): CardSpan | undefined {
1717
</script>
1818

1919
<template>
20-
<ul v-if="cards.length > 0" grid="~ cols-6 gap-16" class="nq-grid nq-raw">
20+
<ul v-if="cards.length > 0" grid="~ cols-6 gap-16" class="nq-grid nq-raw" f-my-md>
2121
<slot>
2222
<li v-for="(card, index) in cards" :key="index" :data-span="getSpan(card)">
2323
<component :is="largeCards ? NqLargeCard : NqCard" v-bind="card" />

0 commit comments

Comments
 (0)