Skip to content

Commit 4f561b2

Browse files
committed
fix: Apply 26px top radius only when overlay is present
Previously the fix always applied 26px to top corners, but this should only happen when an overlay is present. Without overlay, use standard 24px radius. Also consolidates duplicate CSS definitions and cleans up comments.
1 parent 1ba399a commit 4f561b2

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

packages/ui/src/components/Card/SummaryCard.module.css

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@
1717
position: relative;
1818
}
1919

20-
/* Flat variant - Clip image slightly more to fill behind overlay corners */
20+
/* Flat variant - Match Card's border-radius */
2121
.summaryCard[data-variant='flat'] .imageSection {
22+
border-radius: var(--ai-radius-xl);
23+
}
24+
25+
/* Flat variant with overlay - Slightly larger top radius to fill behind overlay corners */
26+
.summaryCard[data-variant='flat'] .imageWrapper[data-has-overlay='true'] .imageSection {
2227
border-top-left-radius: calc(var(--ai-radius-xl) + 2px);
2328
border-top-right-radius: calc(var(--ai-radius-xl) + 2px);
24-
border-bottom-left-radius: 0;
25-
border-bottom-right-radius: 0;
2629
}
2730

2831
/* Flat variant - Match Card's border-radius */
@@ -38,8 +41,11 @@
3841

3942
/* Image Section */
4043
.imageSection {
44+
position: relative;
4145
margin: 0;
42-
padding: 0; /* No padding - card padding handles it */
46+
padding: 0;
47+
overflow: hidden;
48+
border-radius: 16px;
4349
}
4450

4551
.imageSingle {
@@ -437,23 +443,16 @@
437443
border: 0;
438444
}
439445

440-
/* Top Overlay */
446+
/* Top Overlay - Positioned inside imageWrapper, sibling to imageSection */
441447
.topOverlay {
442448
position: absolute;
443449
top: 0;
444450
left: 0;
445451
right: 0;
446452
display: flex;
447453
align-items: center;
448-
z-index: 1; /* Above image, below loading/error states */
449-
border-radius: 16px 16px 0 0; /* Match image top corners */
450-
pointer-events: auto; /* Allow interaction if needed */
451-
box-sizing: border-box; /* Include padding in height calculation */
452-
}
453-
454-
/* Image Section - Make it position relative for absolute overlay positioning */
455-
.imageSection {
456-
position: relative;
457-
overflow: hidden; /* Clip overlay to match image border-radius */
458-
border-radius: 16px; /* Match image border-radius for proper overlay clipping */
454+
z-index: 1;
455+
border-radius: 16px 16px 0 0;
456+
pointer-events: auto;
457+
box-sizing: border-box;
459458
}

packages/ui/src/components/Card/SummaryCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ const SummaryCardComponent = React.forwardRef<HTMLDivElement, SummaryCardProps>(
767767
<>
768768
{/* Image Section */}
769769
{hasImages && (
770-
<div className={styles.imageWrapper}>
770+
<div className={styles.imageWrapper} data-has-overlay={topOverlay ? 'true' : undefined}>
771771
<div className={styles.imageSection}>
772772
{isSingleImage && (
773773
<img

0 commit comments

Comments
 (0)