Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

fix(Card): use divider color borders on all cards (#409)

Cindy Zhang4bc1cf0cf0d7
diff --git a/packages/core/src/Card/XDSCard.tsx b/packages/core/src/Card/XDSCard.tsx
index ab31698b29..99b8b1bdca 100644
--- a/packages/core/src/Card/XDSCard.tsx
+++ b/packages/core/src/Card/XDSCard.tsx
@@ -41,16 +41,13 @@ const styles = stylex.create({
boxShadow: elevationVars['--elevation-base'],
// Clip content to border-radius so nested containers don't peek out corners
overflow: 'clip',
- // Use inherited --card-border-color if set by ancestor, otherwise transparent
borderWidth: 1,
borderStyle: 'solid',
- borderColor: 'var(--card-border-color, transparent)',
+ borderColor: colorVars['--color-divider'],
},
// Inner wrapper: container padding and overflow handling
cardInner: {
height: '100%',
- // Cards have surface background, so nested cards need visible borders
- '--card-border-color': colorVars['--color-divider'],
},
// Only enable scrolling when card has fixed height
scrollable: {
diff --git a/packages/core/src/Section/XDSSection.tsx b/packages/core/src/Section/XDSSection.tsx
index 143d342540..37ee89a0ea 100644
--- a/packages/core/src/Section/XDSSection.tsx
+++ b/packages/core/src/Section/XDSSection.tsx
@@ -43,17 +43,12 @@ declare module '../theme/types' {
const variantStyles = stylex.create({
section: {
backgroundColor: colorVars['--color-surface'],
- // Surface background: nested cards need visible borders
- '--card-border-color': colorVars['--color-divider'],
},
transparent: {
backgroundColor: 'transparent',
- // Transparent inherits --card-border-color from parent
},
wash: {
backgroundColor: colorVars['--color-wash'],
- // Wash background: nested cards don't need borders
- '--card-border-color': 'transparent',
},
});