docs/.vitepress/theme/components/link-card/Card.vue
67 lines · 1244 bytes
1<script setup lang="ts">
2const props = defineProps<{
3 href: string
4 title: string
5 download?: boolean
6}>()
7</script>
8
9<template>
10 <a
11 role="article"
12 :href="props.href"
13 :download="props.download ? '' : undefined"
14 class="vp-card"
15 >
16 <article class="vp-card-container">
17 <h3 class="vp-card-title">{{ props.title }}</h3>
18 <p class="vp-card-details"><slot /></p>
19 </article>
20 </a>
21</template>
22
23<style scoped>
24.vp-card,
25.vp-card:hover,
26.vp-card:focus,
27.vp-card:visited {
28 display: block;
29 border: 1px solid var(--vp-c-bg-soft);
30 border-radius: 12px;
31 height: 100%;
32 background-color: var(--vp-c-bg-soft);
33 transition: border-color 0.25s, background-color 0.25s;
34 text-decoration: none !important;
35 color: inherit !important;
36}
37
38.vp-card:hover {
39 border-color: var(--vp-c-brand-1, #1473e6);
40}
41
42.vp-card-container {
43 display: flex;
44 flex-direction: column;
45 padding: 24px;
46 height: 100%;
47}
48
49.vp-card-title {
50 margin: 0 0 8px;
51 padding: 0;
52 line-height: 24px;
53 font-size: 16px;
54 font-weight: 600;
55 color: var(--vp-c-text-1);
56 border: none;
57 letter-spacing: 0;
58}
59
60.vp-card-details {
61 margin: 0;
62 line-height: 24px;
63 font-size: 14px;
64 font-weight: 500;
65 color: var(--vp-c-text-2);
66}
67</style>