From 53cbee1d3dd66c700b1d9ddc8b21d201db9cc87f Mon Sep 17 00:00:00 2001 From: Matt Ciaccio Date: Fri, 1 May 2026 12:55:09 +0200 Subject: [PATCH] fix(mobile): tighten Card padding on mobile (p-4 sm:p-6) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CardHeader/CardContent/CardFooter were uniformly p-6 (24px), which on top of the mobile shell's 16px outer padding pushed form content 40px inward — making cards feel content-shifted on a 393px viewport. Drops to p-4 (16px) below sm and keeps p-6 from sm+ so desktop is unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/components/ui/card.tsx | 119 ++++++++++++++++--------------------- 1 file changed, 51 insertions(+), 68 deletions(-) diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsx index cabfbfc..496c21a 100644 --- a/src/components/ui/card.tsx +++ b/src/components/ui/card.tsx @@ -1,76 +1,59 @@ -import * as React from "react" +import * as React from 'react'; -import { cn } from "@/lib/utils" +import { cn } from '@/lib/utils'; -const Card = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -
-)) -Card.displayName = "Card" +const Card = React.forwardRef>( + ({ className, ...props }, ref) => ( +
+ ), +); +Card.displayName = 'Card'; -const CardHeader = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -
-)) -CardHeader.displayName = "CardHeader" +const CardHeader = React.forwardRef>( + ({ className, ...props }, ref) => ( +
+ ), +); +CardHeader.displayName = 'CardHeader'; -const CardTitle = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -
-)) -CardTitle.displayName = "CardTitle" +const CardTitle = React.forwardRef>( + ({ className, ...props }, ref) => ( +
+ ), +); +CardTitle.displayName = 'CardTitle'; -const CardDescription = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -
-)) -CardDescription.displayName = "CardDescription" +const CardDescription = React.forwardRef>( + ({ className, ...props }, ref) => ( +
+ ), +); +CardDescription.displayName = 'CardDescription'; -const CardContent = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -
-)) -CardContent.displayName = "CardContent" +const CardContent = React.forwardRef>( + ({ className, ...props }, ref) => ( +
+ ), +); +CardContent.displayName = 'CardContent'; -const CardFooter = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -
-)) -CardFooter.displayName = "CardFooter" +const CardFooter = React.forwardRef>( + ({ className, ...props }, ref) => ( +
+ ), +); +CardFooter.displayName = 'CardFooter'; -export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } +export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };