From b08b1499a2d0e112f3d16096cdc26d25309a6cc7 Mon Sep 17 00:00:00 2001 From: Advay Monga Date: Sun, 20 Sep 2026 00:51:52 -0400 Subject: [PATCH] Gray, thinner outlines for secondary cards Co-Authored-By: Claude Opus 5 --- umd-dining-app/Utilities/UMDColors.swift | 10 +++++++--- umd-dining-app/Views/NutritionDetailView.swift | 4 ++-- umd-dining-app/Views/ProfileView.swift | 6 +++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/umd-dining-app/Utilities/UMDColors.swift b/umd-dining-app/Utilities/UMDColors.swift index 6d9b953..5b510aa 100644 --- a/umd-dining-app/Utilities/UMDColors.swift +++ b/umd-dining-app/Utilities/UMDColors.swift @@ -34,6 +34,8 @@ extension Color { struct HomeCardStyle: ViewModifier { var tint: Color + // Secondary cards (gray) wear a lighter outline than the red ones + var thin: Bool = false @Environment(\.colorScheme) private var colorScheme func body(content: Content) -> some View { @@ -42,7 +44,9 @@ struct HomeCardStyle: ViewModifier { .clipShape(RoundedRectangle(cornerRadius: 12)) .overlay(RoundedRectangle(cornerRadius: 12).stroke( tint.opacity(colorScheme == .dark ? 0.7 : 0.35), - lineWidth: colorScheme == .dark ? 2 : 1.5 + lineWidth: thin + ? (colorScheme == .dark ? 1.5 : 1) + : (colorScheme == .dark ? 2 : 1.5) )) .shadow(color: .black.opacity(colorScheme == .dark ? 0.35 : 0.10), radius: 5, x: 0, y: 2) } @@ -82,8 +86,8 @@ extension View { } extension View { - func homeCard(tint: Color = .umdRed) -> some View { - modifier(HomeCardStyle(tint: tint)) + func homeCard(tint: Color = .umdRed, thin: Bool = false) -> some View { + modifier(HomeCardStyle(tint: tint, thin: thin)) } } diff --git a/umd-dining-app/Views/NutritionDetailView.swift b/umd-dining-app/Views/NutritionDetailView.swift index 87a3336..3523289 100644 --- a/umd-dining-app/Views/NutritionDetailView.swift +++ b/umd-dining-app/Views/NutritionDetailView.swift @@ -236,7 +236,7 @@ struct NutritionDetailView: View { .foregroundStyle(.secondary) .padding(16) .frame(maxWidth: .infinity, alignment: .leading) - .homeCard() + .homeCard(tint: .gray, thin: true) } .padding(.horizontal, 16) } @@ -407,7 +407,7 @@ struct NutritionDetailView: View { } } } - .homeCard() + .homeCard(tint: .gray, thin: true) } .padding(.horizontal, 16) } diff --git a/umd-dining-app/Views/ProfileView.swift b/umd-dining-app/Views/ProfileView.swift index 5f5ce03..193d159 100644 --- a/umd-dining-app/Views/ProfileView.swift +++ b/umd-dining-app/Views/ProfileView.swift @@ -80,7 +80,7 @@ struct ProfileView: View { } } .padding(16) - .homeCard(tint: .gray) + .homeCard(tint: .gray, thin: true) .padding(.horizontal, 16) .padding(.top, 8) .padding(.bottom, 20) @@ -235,7 +235,7 @@ struct ProfileView: View { ) -> some View { Button(action: action) { content() - .homeCard(tint: .gray) + .homeCard(tint: .gray, thin: true) } .buttonStyle(PressableButtonStyle()) } @@ -258,7 +258,7 @@ struct ProfileView: View { } .padding(.horizontal, 16) .padding(.vertical, 16) - .homeCard(tint: .gray) + .homeCard(tint: .gray, thin: true) } // MARK: - Header