From 77fda736b62e1f3da04d4f0d5db0e2152227d03b Mon Sep 17 00:00:00 2001 From: Nusirat12345 Date: Sat, 30 May 2026 13:27:21 +0000 Subject: [PATCH] feat: standardize color system with CSS variables across all pages and components MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace mixed hardcoded Tailwind colors with a unified CSS variable-based semantic token system throughout the entire frontend codebase. ## What changed ### globals.css — extended semantic token set - Kept existing tokens: background, foreground, card, primary, secondary, muted, accent, destructive, border, input, ring - Added surface tokens: --surface, --surface-raised, --surface-overlay (replaces bg-gray-800/700/900 dark surface patterns) - Added status tokens: --success/foreground/muted/muted-foreground, --warning/..., --info/... (replaces green-500, red-500, blue-500 patterns) - Updated --primary to blue (217 91% 60%) to match actual usage - Updated --destructive to full-opacity red in dark mode (0 72% 51%) - Both :root (light) and .dark variants defined for all new tokens ### tailwind.config.ts — new utility classes Added Tailwind color mappings for all new tokens: bg-surface, bg-surface-raised, bg-surface-overlay bg-success, text-success, border-success, bg-success-muted, etc. bg-warning, text-warning, bg-warning-muted, etc. bg-info, text-info, bg-info-muted, etc. ### 97 component/page files migrated Common patterns replaced: bg-blue-500/600 → bg-primary / bg-primary/90 text-blue-500/600 → text-primary border-blue-500 → border-primary ring-blue-500 → ring-primary bg-green-500/600 → bg-success / bg-success/90 text-green-500/600→ text-success bg-red-500 → bg-destructive text-red-500/600 → text-destructive bg-gray-800 → bg-surface bg-gray-900 → bg-background bg-gray-700 → bg-surface-raised border-gray-700 → border-border text-gray-400 → text-muted-foreground text-gray-300 → text-foreground/80 text-slate-400/500→ text-muted-foreground text-slate-300 → text-foreground/80 ### Tests updated - profile-header.test.tsx: updated online-indicator assertions from bg-green-500 → bg-success to match migrated component Closes #369 --- .../src/__tests__/profile-header.test.tsx | 4 +- frontend/src/app/accessibility/page.tsx | 2 +- frontend/src/app/achievements/page.tsx | 6 +- frontend/src/app/admin/disputes/page.tsx | 24 ++++---- frontend/src/app/admin/governance/page.tsx | 12 ++-- frontend/src/app/admin/kyc/page.tsx | 14 ++--- frontend/src/app/contact/ContactForm.tsx | 4 +- frontend/src/app/dashboard/friends/page.tsx | 2 +- frontend/src/app/dashboard/profile/page.tsx | 2 +- frontend/src/app/friends/page.tsx | 22 +++---- frontend/src/app/leaderboards/page.tsx | 22 +++---- frontend/src/app/matches/[id]/page.tsx | 54 ++++++++--------- frontend/src/app/messages/page.tsx | 34 +++++------ frontend/src/app/party/page.tsx | 20 +++---- frontend/src/app/play/lobby/page.tsx | 2 +- frontend/src/app/play/page.tsx | 8 +-- frontend/src/app/play/party/page.tsx | 2 +- frontend/src/app/profile/edit/page.tsx | 4 +- frontend/src/app/profile/page.tsx | 2 +- frontend/src/app/profile/settings/page.tsx | 2 +- .../src/app/settings/accessibility/page.tsx | 2 +- frontend/src/app/settings/account/page.tsx | 2 +- frontend/src/app/settings/game/page.tsx | 2 +- .../src/app/settings/keybindings/page.tsx | 2 +- .../src/app/settings/notifications/page.tsx | 2 +- frontend/src/app/settings/privacy/page.tsx | 2 +- frontend/src/app/settings/theme/page.tsx | 2 +- frontend/src/app/tournaments/[id]/page.tsx | 8 +-- frontend/src/app/tournaments/create/page.tsx | 60 +++++++++---------- .../achievements/AchievementCard.tsx | 2 +- .../achievements/AchievementDetails.tsx | 4 +- .../components/achievements/ProgressBar.tsx | 2 +- .../achievements/UnlockAnimation.tsx | 4 +- frontend/src/components/auth/AuthLayout.tsx | 10 ++-- .../src/components/auth/EmailVerification.tsx | 8 +-- frontend/src/components/auth/LoginForm.tsx | 10 ++-- .../src/components/auth/PasswordResetForm.tsx | 8 +-- .../auth/PasswordStrengthIndicator.tsx | 8 +-- frontend/src/components/auth/RegisterForm.tsx | 18 +++--- frontend/src/components/auth/SocialLogin.tsx | 2 +- .../components/bracket/BracketMatchModal.tsx | 36 +++++------ .../bracket/SingleEliminationBracket.tsx | 48 +++++++-------- .../src/components/dashboard/FriendsList.tsx | 2 +- .../src/components/dashboard/NewsFeed.tsx | 2 +- .../src/components/dashboard/QuickPlay.tsx | 4 +- .../src/components/dashboard/RecentGames.tsx | 2 +- .../components/dashboard/StatsOverview.tsx | 6 +- frontend/src/components/game/ChatPanel.tsx | 4 +- .../src/components/game/CountdownTimer.tsx | 2 +- .../src/components/game/GameModeSelector.tsx | 6 +- frontend/src/components/game/GameSettings.tsx | 8 +-- .../src/components/game/MatchmakingQueue.tsx | 20 +++---- frontend/src/components/game/PartyManager.tsx | 10 ++-- frontend/src/components/game/PlayerList.tsx | 4 +- .../leaderboard/CategorySelector.tsx | 8 +-- .../leaderboard/LeaderboardFilters.tsx | 14 ++--- .../leaderboard/LeaderboardTable.tsx | 36 +++++------ .../components/leaderboard/PersonalRank.tsx | 20 +++---- .../components/leaderboard/PlayerRankCard.tsx | 42 ++++++------- .../src/components/leaderboard/RankChange.tsx | 8 +-- .../components/leaderboard/SeasonSelector.tsx | 6 +- .../src/components/match/MatchDetailView.tsx | 26 ++++---- .../src/components/notifications/Toast.tsx | 4 +- .../profile/AchievementShowcase.tsx | 12 ++-- .../src/components/profile/ActivityFeed.tsx | 4 +- .../src/components/profile/FriendsList.tsx | 4 +- .../src/components/profile/MatchHistory.tsx | 10 ++-- .../src/components/profile/ProfileHeader.tsx | 18 +++--- .../src/components/profile/StatsOverview.tsx | 18 +++--- .../settings/AccessibilityOptions.tsx | 14 ++--- .../components/settings/AccountSettings.tsx | 26 ++++---- .../components/settings/GamePreferences.tsx | 14 ++--- .../src/components/settings/KeyBindings.tsx | 14 ++--- .../settings/NotificationSettings.tsx | 26 ++++---- .../components/settings/PrivacySettings.tsx | 22 +++---- .../src/components/settings/ThemeSelector.tsx | 42 ++++++------- .../src/components/social/ChatInterface.tsx | 6 +- .../src/components/social/CommunityFeed.tsx | 12 ++-- .../src/components/social/FriendRequests.tsx | 6 +- .../src/components/social/FriendsList.tsx | 4 +- .../src/components/social/InviteFriends.tsx | 6 +- .../src/components/social/OnlineStatus.tsx | 6 +- .../src/components/social/PartyManager.tsx | 10 ++-- .../tournaments/JoinTournamentButton.tsx | 48 +++++++-------- .../src/components/tournaments/MatchCard.tsx | 24 ++++---- .../src/components/tournaments/PrizePool.tsx | 2 +- .../components/tournaments/QuickJoinModal.tsx | 20 +++---- .../tournaments/RegistrationForm.tsx | 22 +++---- .../tournaments/TournamentBracket.tsx | 6 +- .../components/tournaments/TournamentCard.tsx | 16 ++--- .../TournamentCardWithQuickJoin.tsx | 18 +++--- .../tournaments/TournamentHeader.tsx | 22 +++---- .../tournaments/TournamentParticipants.tsx | 8 +-- .../tournaments/TournamentRules.tsx | 12 ++-- frontend/src/components/ui/Button.tsx | 8 +-- frontend/src/components/ui/SkipLink.tsx | 2 +- .../components/wallet/TransactionHistory.tsx | 4 +- .../components/wallet/TransactionToasts.tsx | 2 +- frontend/src/styles/globals.css | 54 +++++++++++++++-- frontend/tailwind.config.ts | 23 +++++++ 100 files changed, 674 insertions(+), 609 deletions(-) diff --git a/frontend/src/__tests__/profile-header.test.tsx b/frontend/src/__tests__/profile-header.test.tsx index 94e1472d..2c7179fa 100644 --- a/frontend/src/__tests__/profile-header.test.tsx +++ b/frontend/src/__tests__/profile-header.test.tsx @@ -101,7 +101,7 @@ describe('ProfileHeader', () => { ); const indicator = screen.getByTestId('online-indicator'); - expect(indicator).toHaveClass('bg-green-500'); + expect(indicator).toHaveClass('bg-success'); expect(indicator).not.toHaveClass('bg-gray-400'); }); @@ -111,6 +111,6 @@ describe('ProfileHeader', () => { ); const indicator = screen.getByTestId('online-indicator'); expect(indicator).toHaveClass('bg-gray-400'); - expect(indicator).not.toHaveClass('bg-green-500'); + expect(indicator).not.toHaveClass('bg-success'); }); }); diff --git a/frontend/src/app/accessibility/page.tsx b/frontend/src/app/accessibility/page.tsx index 8ab046eb..b43124fc 100644 --- a/frontend/src/app/accessibility/page.tsx +++ b/frontend/src/app/accessibility/page.tsx @@ -60,7 +60,7 @@ export default function AccessibilityPage() { We welcome your feedback on the accessibility of ArenaX. Please let us know if you encounter accessibility barriers:

- + Contact Us diff --git a/frontend/src/app/achievements/page.tsx b/frontend/src/app/achievements/page.tsx index 1bb7899f..4a960fd9 100644 --- a/frontend/src/app/achievements/page.tsx +++ b/frontend/src/app/achievements/page.tsx @@ -22,7 +22,7 @@ export default function AchievementsPage() { if (isLoading) { return (
-
+
); } @@ -40,14 +40,14 @@ export default function AchievementsPage() { Achievements -

+

{unlockedCount} of {totalAchievements} unlocked · {totalPoints}{" "} points earned

📊 View Progress diff --git a/frontend/src/app/admin/disputes/page.tsx b/frontend/src/app/admin/disputes/page.tsx index 7d388eba..5a09d327 100644 --- a/frontend/src/app/admin/disputes/page.tsx +++ b/frontend/src/app/admin/disputes/page.tsx @@ -44,7 +44,7 @@ export default function DisputeDashboard() {
-

+

Dispute Resolution

@@ -81,16 +81,16 @@ export default function DisputeDashboard() {

-

Reason

-

+

Reason

+

{dispute.reason}

-

Evidence

+

Evidence

{dispute.evidenceUrls.map((url: string, index: number) => ( -
+
{/* eslint-disable-next-line @next/next/no-img-element */} {`Evidence
@@ -100,19 +100,19 @@ export default function DisputeDashboard() {
-

Match Details

+

Match Details

-
-

Player A

+
+

Player A

{dispute.match.playerAId}

-
-

Player B

+
+

Player B

{dispute.match.playerBId}

-
-

Reported Winner

+
+

Reported Winner

{dispute.match.winnerId === dispute.match.playerAId ? "Player A" : "Player B"}

diff --git a/frontend/src/app/admin/governance/page.tsx b/frontend/src/app/admin/governance/page.tsx index a6486c74..bcfbe2fe 100644 --- a/frontend/src/app/admin/governance/page.tsx +++ b/frontend/src/app/admin/governance/page.tsx @@ -47,7 +47,7 @@ export default function GovernanceDashboard() {
-

+

Governance

@@ -85,9 +85,9 @@ export default function GovernanceDashboard() {

-
-

Target Contract

-

{proposal.targetContract}

+
+

Target Contract

+

{proposal.targetContract}

@@ -101,7 +101,7 @@ export default function GovernanceDashboard() { {proposal._count.votes} / 3 signatures

-
+
)} {proposal.status === "VOTING" && ( - )} diff --git a/frontend/src/app/admin/kyc/page.tsx b/frontend/src/app/admin/kyc/page.tsx index 7a58621b..7760c898 100644 --- a/frontend/src/app/admin/kyc/page.tsx +++ b/frontend/src/app/admin/kyc/page.tsx @@ -90,7 +90,7 @@ export default function KycDashboard() {
-

+

KYC Review Queue

@@ -135,8 +135,8 @@ export default function KycDashboard() { {review.user.username} {review.status} @@ -213,7 +213,7 @@ export default function KycDashboard() {

) : (
Final State: {selectedReview.status} diff --git a/frontend/src/app/contact/ContactForm.tsx b/frontend/src/app/contact/ContactForm.tsx index 7b81b4c2..b760ac8c 100644 --- a/frontend/src/app/contact/ContactForm.tsx +++ b/frontend/src/app/contact/ContactForm.tsx @@ -59,8 +59,8 @@ export function ContactForm() { animate={{ opacity: 1, y: 0 }} className="text-center py-8" > -
- +
+

Message Sent!

diff --git a/frontend/src/app/dashboard/friends/page.tsx b/frontend/src/app/dashboard/friends/page.tsx index 206b1648..4ef99022 100644 --- a/frontend/src/app/dashboard/friends/page.tsx +++ b/frontend/src/app/dashboard/friends/page.tsx @@ -24,7 +24,7 @@ const mockFriends: Friend[] = [ ]; const statusConfig = { - online: { label: "Online", dot: "bg-green-500" }, + online: { label: "Online", dot: "bg-success" }, "in-game": { label: "In Game", dot: "bg-yellow-500" }, offline: { label: "Offline", dot: "bg-muted-foreground/50" }, }; diff --git a/frontend/src/app/dashboard/profile/page.tsx b/frontend/src/app/dashboard/profile/page.tsx index fbe7ac49..9f364229 100644 --- a/frontend/src/app/dashboard/profile/page.tsx +++ b/frontend/src/app/dashboard/profile/page.tsx @@ -31,7 +31,7 @@ export default function DashboardProfilePage() { {user.username.charAt(0)} )}

-
+

{user.username}

diff --git a/frontend/src/app/friends/page.tsx b/frontend/src/app/friends/page.tsx index f6fa9d3a..f9cf3564 100644 --- a/frontend/src/app/friends/page.tsx +++ b/frontend/src/app/friends/page.tsx @@ -32,19 +32,19 @@ export default function FriendsPage() { Friends -

+

{onlineFriends} of {friends.length} friends online

{/* Tabs */} -
+
)) ) : ( -
+
No conversations yet
)} @@ -98,11 +98,11 @@ export default function MessagesPage() {
{/* Chat Area */} -
+
{selectedConversation ? ( <> {/* Chat Header */} -
+

{selectedConversation.participantUsername}

@@ -110,14 +110,14 @@ export default function MessagesPage() { {/* Messages Area */}
-
+
Start of conversation with{" "} {selectedConversation.participantUsername}
{/* Message Input */} -
+
{ if (e.key === "Enter") handleSendMessage(); }} - className="flex-1 bg-gray-700 border border-gray-600 rounded-lg px-4 py-2 text-white placeholder-gray-400 focus:outline-none focus:border-blue-500" + className="flex-1 bg-surface-raised border border-gray-600 rounded-lg px-4 py-2 text-white placeholder-gray-400 focus:outline-none focus:border-primary" /> @@ -142,7 +142,7 @@ export default function MessagesPage() {
) : ( -
+
Select a conversation to start messaging
)} diff --git a/frontend/src/app/party/page.tsx b/frontend/src/app/party/page.tsx index 6cbd8921..aa087329 100644 --- a/frontend/src/app/party/page.tsx +++ b/frontend/src/app/party/page.tsx @@ -43,7 +43,7 @@ export default function PartyPage() { Party System -

+

Create or join a party to play with friends

@@ -51,7 +51,7 @@ export default function PartyPage() { {/* Create Party Button */}