Skip to content

Commit 810e26a

Browse files
committed
add overflow prop on Card
1 parent 03546b6 commit 810e26a

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/components/pages/downloads/CoreCard.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const PLATFORM_ICONS: Record<string, ImageMetadata> = {
6262
};
6363
---
6464

65-
<Card padding="none" class="download-card" id={id} {...rest}>
65+
<Card padding="none" overflow="visible" class="download-card" id={id} {...rest}>
6666
<div class="card-image">
6767
<Image src={image} alt="" format="avif" />
6868
</div>

src/components/ui/Card.astro

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ import type { HTMLTag } from "astro/types";
33
44
type Padding = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
55
type Radius = "none" | "sm" | "md" | "lg" | "xl";
6+
type Overflow = "hidden" | "visible";
67
78
interface Props {
89
padding?: Padding;
910
radius?: Radius;
11+
overflow?: Overflow;
1012
border?: boolean;
1113
hover?: boolean;
1214
transparent?: boolean;
@@ -18,6 +20,7 @@ interface Props {
1820
const {
1921
padding = "xl",
2022
radius = "md",
23+
overflow = "hidden",
2124
border = false,
2225
hover = false,
2326
transparent = false,
@@ -35,7 +38,7 @@ const cardRadius = radius === "none" ? "0" : `var(--radius-${radius})`;
3538
data-border={border || undefined}
3639
data-hover={hover || undefined}
3740
data-transparent={transparent || undefined}
38-
style={`--card-padding: ${cardPadding}; --card-radius: ${cardRadius}`}
41+
style={`--card-padding: ${cardPadding}; --card-radius: ${cardRadius}; --card-overflow: ${overflow}`}
3942
{...rest}
4043
>
4144
<slot />
@@ -46,7 +49,7 @@ const cardRadius = radius === "none" ? "0" : `var(--radius-${radius})`;
4649
background: var(--card-color);
4750
padding: var(--card-padding);
4851
border-radius: var(--card-radius);
49-
overflow: hidden;
52+
overflow: var(--card-overflow);
5053

5154
&[data-border] {
5255
border: 1px solid var(--border-color);

0 commit comments

Comments
 (0)