-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCard.astro
More file actions
80 lines (71 loc) · 1.52 KB
/
Card.astro
File metadata and controls
80 lines (71 loc) · 1.52 KB
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
79
80
---
interface Props {
backgroundColor?: string;
icon?: string | undefined;
title?: string | undefined;
}
const { backgroundColor, icon = "🚀", title } = Astro.props;
---
<div class="card-box">
<div class="card-title-line">
<div class="card-icon">{icon}</div>
<div class="card-title">{title}</div>
</div>
<div class="card-content">
<slot />
</div>
</div>
<style define:vars={{ backgroundColor }}>
.card-box {
background-color: color-mix(
in srgb,
var(--bg-color-dimmer) 80%,
transparent
);
border-radius: 1em;
width: 100%;
height: 100%;
box-sizing: border-box;
display: flex;
flex-direction: column;
padding: 1.2em;
gap: 1em;
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
border: 1px solid var(--border-color);
}
.card-title-line {
width: 100%;
height: fit-content;
box-sizing: border-box;
display: flex;
flex-direction: row;
align-items: center;
gap: 0.8rem;
opacity: 1;
}
.card-title {
flex: 1;
min-width: 0;
font-size: 16px;
font-weight: bold;
line-height: 1.3;
}
.card-icon {
background: var(--bg-color-dimmer-dimmer);
border-radius: 1rem;
width: 3.2rem;
height: 3.2rem;
box-sizing: border-box;
display: grid;
place-items: center;
font-size: 1.5rem;
user-select: none;
}
.card-content {
opacity: 1;
font-size: 14px;
color: var(--text-color-dimmer);
}
</style>