/
VPFeature.vue
78 lines (69 loc) · 1.33 KB
/
VPFeature.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<script setup lang="ts">
import VPButton from './VPButton.vue'
export interface FeatureAction {
theme?: 'brand' | 'alt'
text: string
link: string
}
defineProps<{
icon?: string
title: string
details: string
action?: FeatureAction
}>()
</script>
<template>
<article class="VPFeature">
<div v-if="icon" class="icon">{{ icon }}</div>
<h2 class="title">{{ title }}</h2>
<p class="details">{{ details }}</p>
<div class="feature-actions">
<VPButton
v-if="action"
tag="a"
size="small"
:theme="action.theme"
:text="action.text"
:href="action.link"
/>
</div>
</article>
</template>
<style scoped>
.VPFeature {
border: 1px solid var(--vp-c-bg-soft);
border-radius: 12px;
padding: 24px;
height: 100%;
background-color: var(--vp-c-bg-soft);
}
.icon {
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 20px;
border-radius: 6px;
background-color: var(--vp-c-gray-light-4);
width: 48px;
height: 48px;
font-size: 24px;
}
.dark .icon {
background-color: var(--vp-c-bg);
}
.title {
line-height: 24px;
font-size: 16px;
font-weight: 600;
}
.details {
padding-top: 8px;
line-height: 24px;
font-size: 14px;
font-weight: 500;
color: var(--vp-c-text-2);
}
.feature-actions {
padding-top: 16px;
}
</style>