Feature/refactor v 1 be#26
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. Implementing a centralized color token system using Tailwind CSS v4.1's
@themedirective.The goal is to create a maintainable, consistent, and themeable color system that aligns with the Star Wars aesthetic while providing flexibility for future theming.
Current State Analysis
Current Color Usage (from code audit)
bg-neutral-900,bg-black#000000,#171717bg-neutral-800/20,bg-neutral-800/5text-neutral-200,text-white#e5e5e5,#fffffftext-neutral-400,text-neutral-300#a3a3a3,#d4d4d4text-yellow-400,text-yellow-500#facc15,#eab308text-red-500,text-red-600#ef4444,#dc2626border-neutral-700/50,border-neutral-600text-green-500,bg-green-500#22c55etext-red-500,bg-red-500#ef4444text-blue-400#60a5faProblems with Current Approach
neutral-*scale with arbitrary opacity valuesneutral-400doesn't convey purpose/20,/50,/5) make it hard to trackProposed Color Token Architecture
Design Tokens Structure
Token Definitions
Background Colors
--color-bg#0a0a0a--color-bg-cardrgba(23, 23, 23, 0.6)--color-bg-elevated#171717--color-bg-overlayrgba(0, 0, 0, 0.8)--color-bg-inputrgba(38, 38, 38, 0.5)Foreground (Text) Colors
--color-text#f5f5f5--color-text-muted#a3a3a3--color-text-subtle#737373--color-text-inverse#0a0a0aAccent Colors (Star Wars Yellow)
--color-accent#ffc500--color-accent-hover#ffdb4d--color-accent-mutedrgba(255, 197, 0, 0.2)--color-accent-contrast#0a0a0aSemantic Colors
--color-success#22c55e--color-success-mutedrgba(34, 197, 94, 0.2)--color-warning#eab308--color-error#ef4444--color-error-mutedrgba(239, 68, 68, 0.2)--color-info#3b82f6Border Colors
--color-borderrgba(64, 64, 64, 0.5)--color-border-mutedrgba(64, 64, 64, 0.3)--color-border-accentrgba(255, 197, 0, 0.3)--color-border-focus#ffc500Star Wars Specific
--color-sw-green#2ff924--color-sw-blue#00b4d8--color-sw-red#ff2a2a--color-sw-cyan#00f0ff--color-sw-purple#9333eaImplementation Plan
Phase 1: Setup Theme Configuration
Update
frontend/src/index.css:Phase 2: Component Migration Strategy
Priority order for migration:
High Priority (Core UI):
Button.jsxandSpaceBtn.jsxNavigation.jsxToaster.jsxMedium Priority (Content Components):
Characters.jsxCharacterDetail.jsxCharactersForm.jsxLower Priority (Forms & Auth):
LoginForm.jsxRegisterForm.jsxUserProfile.jsxLow Priority (Skeleton & UI):
SkeletonCard.jsxSkeletonDetail.jsxInfoPage.jsxPhase 3: Migration Examples
Before (Current)
After (With Tokens)
Phase 4: Create Migration Script
Create a Node.js script to help with migration:
Benefits
Future Enhancements
Migration Checklist
@themedirective inindex.cssReferences ✨
2.
UserProfile.jsxUI Refactor AnalysisCurrent state of UserProfile:
I have done anything to polish the UI
Comparing to Characters.jsx & CharacterDetail.jsx cards:
Refactor plan for
UserProfile:6 Proper spacing - Use the same padding/gap patterns as CharacterDetail
┌─────────────────────────────────────┐
│ Avatar Section (centered, larger) │
│ │
│ ┌─ Profile Information ─┐ │
│ │ Name field │ │
│ │ Bio field (larger) │ │
│ │ Location field │ │
│ │ Avatar URL field │ │
│ └───────────────────────┘ │
│ │
│ [Update Profile] [Return Home] │
│ │
│ Success/Error Message │
└─────────────────────────────────────┘