From 564c98c8059a2d6a50fa76c299849fe0ab14dce6 Mon Sep 17 00:00:00 2001 From: Rami Bitar Date: Fri, 8 May 2026 10:01:55 -0400 Subject: [PATCH] Consolidate theme radius/shadow props and make rounded utilities responsive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove duplicate roundedness/shadowLevel props (keep radius/shadow) - Switch globals.css radius scale to proportional (square→pill works) - Replace rounded-full with rounded-md on theme-driven elements - Remove banner props from Navigation, drop publishing overlay Co-Authored-By: Claude Sonnet 4.6 --- app.schema.json | 8 ++--- components/ThemeProvider.tsx | 35 ++++----------------- components/commerce/featured-product.tsx | 8 ++--- components/commerce/product-details.tsx | 16 +++++----- components/cta/cta.tsx | 4 +-- components/hero/hero.tsx | 4 +-- components/navigation/navigation.editor.tsx | 16 ---------- components/navigation/navigation.tsx | 19 ----------- config/root.tsx | 35 +++------------------ src/App.tsx | 5 --- src/globals.css | 12 +++---- 11 files changed, 34 insertions(+), 128 deletions(-) diff --git a/app.schema.json b/app.schema.json index d3569a9..da14dfe 100644 --- a/app.schema.json +++ b/app.schema.json @@ -11,9 +11,7 @@ "bgColor": "#ffffff", "fgColor": "#0a0a0a", "mutedColor": "#f5f5f5", - "roundedness": "md", - "radius": "md", - "shadowLevel": "sm", + "radius": "sm", "shadow": "sm", "maxWidth": "xl" } @@ -201,9 +199,7 @@ "bgColor": "#ffffff", "fgColor": "#0a0a0a", "mutedColor": "#f5f5f5", - "roundedness": "md", - "radius": "md", - "shadowLevel": "sm", + "radius": "sm", "shadow": "sm", "maxWidth": "xl" } diff --git a/components/ThemeProvider.tsx b/components/ThemeProvider.tsx index c2fdf54..ca12c7d 100644 --- a/components/ThemeProvider.tsx +++ b/components/ThemeProvider.tsx @@ -13,14 +13,12 @@ export type ThemeProps = { mutedColor?: string; mutedForegroundColor?: string; borderColor?: string; - roundedness?: "none" | "sm" | "md" | "lg" | "xl" | "full"; - radius?: "none" | "xs" | "sm" | "md" | "lg"; - shadowLevel?: "none" | "sm" | "md" | "lg" | "xl"; - shadow?: "none" | "sm" | "md" | "lg"; + radius?: "none" | "sm" | "md" | "lg" | "xl" | "full"; + shadow?: "none" | "sm" | "md" | "lg" | "xl"; maxWidth?: "sm" | "md" | "lg" | "xl" | "2xl" | "full"; }; -const radiusMap: Record, string> = { +const radiusMap: Record, string> = { none: "0px", sm: "0.25rem", md: "0.5rem", @@ -29,15 +27,7 @@ const radiusMap: Record, string> = { full: "9999px", }; -const radiusEnumMap: Record, string> = { - none: "0px", - xs: "0.125rem", - sm: "0.25rem", - md: "0.5rem", - lg: "0.75rem", -}; - -const shadowMap: Record, string> = { +const shadowMap: Record, string> = { none: "0 0 #0000", sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)", md: "0 4px 6px -1px rgb(0 0 0 / 0.10), 0 2px 4px -2px rgb(0 0 0 / 0.10)", @@ -45,13 +35,6 @@ const shadowMap: Record, string> = { xl: "0 20px 25px -5px rgb(0 0 0 / 0.10), 0 8px 10px -6px rgb(0 0 0 / 0.10)", }; -const shadowEnumMap: Record, string> = { - none: "0 0 #0000", - sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)", - md: "0 4px 6px -1px rgb(0 0 0 / 0.10), 0 2px 4px -2px rgb(0 0 0 / 0.10)", - lg: "0 10px 15px -3px rgb(0 0 0 / 0.10), 0 4px 6px -4px rgb(0 0 0 / 0.10)", -}; - function googleFontsHref(headerFont?: string, bodyFont?: string): string | null { const fonts = [headerFont, bodyFont].filter( (f): f is string => !!f && f !== "system-ui" @@ -75,9 +58,7 @@ export function ThemeProvider({ mutedColor, mutedForegroundColor, borderColor, - roundedness, radius, - shadowLevel, shadow, children, }: ThemeProps & { children?: React.ReactNode }) { @@ -93,10 +74,8 @@ export function ThemeProvider({ if (mutedColor) vars["--muted"] = mutedColor; if (mutedForegroundColor) vars["--muted-foreground"] = mutedForegroundColor; if (borderColor) vars["--border"] = borderColor; - if (radius) vars["--radius"] = radiusEnumMap[radius]; - else if (roundedness) vars["--radius"] = radiusMap[roundedness]; - if (shadow) vars["--shadow"] = shadowEnumMap[shadow]; - else if (shadowLevel) vars["--shadow"] = shadowMap[shadowLevel]; + if (radius) vars["--radius"] = radiusMap[radius]; + if (shadow) vars["--shadow"] = shadowMap[shadow]; if (headerFont) vars["--font-header"] = `"${headerFont}", system-ui, sans-serif`; if (bodyFont) vars["--font-body"] = `"${bodyFont}", system-ui, sans-serif`; return vars; @@ -112,9 +91,7 @@ export function ThemeProvider({ mutedColor, mutedForegroundColor, borderColor, - roundedness, radius, - shadowLevel, shadow, ]); diff --git a/components/commerce/featured-product.tsx b/components/commerce/featured-product.tsx index e217f40..e7c837c 100644 --- a/components/commerce/featured-product.tsx +++ b/components/commerce/featured-product.tsx @@ -47,8 +47,8 @@ export function FeaturedProductView({
- - + +
@@ -111,13 +111,13 @@ export function FeaturedProductView({ await cart.addItem(variant.id, 1); cart.openCart(); }} - className="inline-flex items-center justify-center rounded-full bg-foreground px-6 py-3 text-sm font-medium tracking-wide text-background hover:opacity-90" + className="inline-flex items-center justify-center rounded-md bg-foreground px-6 py-3 text-sm font-medium tracking-wide text-background hover:opacity-90" > {ctaLabel} View details diff --git a/components/commerce/product-details.tsx b/components/commerce/product-details.tsx index d68eda4..f38f5cd 100644 --- a/components/commerce/product-details.tsx +++ b/components/commerce/product-details.tsx @@ -46,14 +46,14 @@ export function ProductDetailsView({ product: selected }: ProductDetailsProps) {
- - - + + +
- - + +
@@ -157,7 +157,7 @@ export function ProductDetailsView({ product: selected }: ProductDetailsProps) { key={val} onClick={() => matching && setVariant(matching.node)} className={cn( - "min-w-12 rounded-full border px-4 py-2 text-sm transition-colors", + "min-w-12 rounded-md border px-4 py-2 text-sm transition-colors", selected ? "border-foreground bg-foreground text-background" : "border-border hover:border-foreground", @@ -172,7 +172,7 @@ export function ProductDetailsView({ product: selected }: ProductDetailsProps) { ))}
-
+