Fix Card selection layout shift and add transitions
- Reserve 2px border on all cards (transparent for elevated, coloured for outlined) so selected state only changes colour, not width - Add 150ms ease-in-out transitions for border-color and background-color consistent with Button/Input interactive timing - Remove borderWidth/borderStyle from selected sx (now handled by theme) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -63,10 +63,9 @@ export const Card = React.forwardRef<HTMLDivElement, CardProps>(
|
||||
elevation={0}
|
||||
sx={[
|
||||
// Selected state: brand border + warm background
|
||||
// Border width is always 2px (set in theme) — only colour changes here
|
||||
selected && {
|
||||
borderColor: 'var(--fa-card-border-selected)',
|
||||
borderWidth: '2px',
|
||||
borderStyle: 'solid',
|
||||
backgroundColor: 'var(--fa-card-background-selected)',
|
||||
},
|
||||
// Interactive: hover fill + shadow lift + pointer
|
||||
|
||||
Reference in New Issue
Block a user