Skip to content

Commit f2a0f5c

Browse files
fix(card): add border radius to slotted content to match parent card
Co-authored-by: Marissa Huysentruyt <[email protected]>
1 parent 3e803bc commit f2a0f5c

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

packages/card/src/card.css

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ slot[name="description"] {
5858

5959
:host(:not([variant="gallery"])) #preview ::slotted(*) {
6060
height: 100%;
61+
border-radius: calc(var(--spectrum-card-corner-radius) - var(--spectrum-focus-indicator-thickness));
6162
}
6263

6364
:host([horizontal]) #preview {
@@ -97,23 +98,12 @@ sp-popover {
9798
pointer-events: none;
9899
}
99100

100-
:host([variant='quiet']:focus) #preview:after {
101-
border: var(
102-
--mod-card-focus-indicator-width,
103-
var(--spectrum-card-focus-indicator-width)
104-
)
105-
solid
106-
var(
107-
--mod-card-focus-indicator-color,
108-
var(--spectrum-card-focus-indicator-color)
109-
);
101+
:host([variant="quiet"]:focus) #preview:after {
102+
border: var(--mod-card-focus-indicator-width, var(--spectrum-card-focus-indicator-width)) solid var(--mod-card-focus-indicator-color, var(--spectrum-card-focus-indicator-color));
110103
}
111104

112-
:host([variant='quiet'][selected]:focus) #preview {
113-
border-width: var(
114-
--mod-card-focus-indicator-width,
115-
var(--spectrum-card-focus-indicator-width)
116-
);
105+
:host([variant="quiet"][selected]:focus) #preview {
106+
border-width: var(--mod-card-focus-indicator-width, var(--spectrum-card-focus-indicator-width));
117107
}
118108

119109
/* This ensures that the checkbox is tabbable when the card toggles but is not itself focusable */

0 commit comments

Comments
 (0)