Skip to the content.

Project-Wide Theme Migration - Implementation Summary

✅ COMPLETED (Fully Updated with Theme Tokens)

Core Infrastructure

Components

Landing & Public Pages

Auth Pages - Verification/Reset


🔄 REMAINING UPDATES NEEDED

The following files still have hardcoded colors and need updating. You can use the patterns from docs/COLOR_MIGRATION_MAPPING.md to guide these updates.

Auth Pages (3 files)

  1. src/app/auth/signup/page.tsx
    • Gradient background
    • Card backgrounds, text colors
    • Form inputs
    • Primary button
    • Error/success messages
  2. src/app/auth/forgot-password/page.tsx
    • Same patterns as signin
  3. src/app/auth/reset-password/page.tsx
    • Already partially updated (has Footer)
    • Complete remaining sections

Members Area (Estimate: 1-2 files)

  1. src/app/members/page.tsx
    • Navigation bar
    • Card backgrounds (many instances)
    • Buttons (yellow-600 → primary)
    • Text colors
    • Survey banner (blue accent)
    • Gradient backgrounds
  2. src/app/members/layout.tsx (if exists with styles)

Admin Area (Estimate: 5-10 files)

  1. src/app/admin/users/page.tsx
  2. src/app/admin/analytics/page.tsx
  3. src/app/admin/data-management/page.tsx
  4. src/app/admin/*.tsx (any other admin pages)
  1. src/app/legal-notice/page.tsx
  2. src/app/privacy/page.tsx (if exists)

Components (Estimate: 2-5 files)

  1. src/components/contact-modal.tsx
  2. src/components/apartment-input.tsx (if has colors)
  3. src/components/theme-toggle.tsx (check for hardcoded colors)
  4. src/components/language-switcher.tsx (check for hardcoded colors)
  5. Any other components found with grep -r "bg-yellow-\|bg-stone-\|bg-blue-" src/components/

📋 AUTOMATED UPDATE SCRIPT

Here’s a bash script you can run to update the remaining files. Review each change before committing!

#!/bin/bash

# Backup first
cp -r src src.backup

# Function to replace colors in a file
update_file() {
  local file=$1
  
  # Primary buttons
  sed -i 's/bg-yellow-600 hover:bg-yellow-700 dark:bg-yellow-500 dark:hover:bg-yellow-600 text-white/bg-primary hover:bg-primary-hover text-primary-foreground/g' "$file"
  
  # Secondary buttons
  sed -i 's/bg-stone-600 hover:bg-stone-700 dark:bg-stone-700 dark:hover:bg-stone-600 text-white/bg-secondary hover:bg-secondary-hover text-secondary-foreground/g' "$file"
  
  # Accent/Blue buttons
  sed -i 's/bg-blue-600 hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600 text-white/bg-accent hover:bg-accent-hover text-accent-foreground/g' "$file"
  
  # Card backgrounds
  sed -i 's/bg-white dark:bg-gray-800/bg-card/g' "$file"
  sed -i 's/bg-white dark:bg-gray-900/bg-nav-background/g' "$file"
  
  # Gradients
  sed -i 's/bg-gradient-to-br from-stone-50 to-gray-100 dark:from-gray-900 dark:to-gray-800/bg-gradient-to-br from-[var(--background-gradient-from)] to-[var(--background-gradient-to)]/g' "$file"
  
  # Main text
  sed -i 's/text-stone-800 dark:text-stone-200/text-foreground/g' "$file"
  sed -i 's/text-stone-800 dark:text-stone-200/text-card-foreground/g' "$file"
  
  # Secondary text  
  sed -i 's/text-stone-600 dark:text-stone-400/text-foreground-secondary/g' "$file"
  
  # Muted text
  sed -i 's/text-stone-400 dark:text-stone-400/text-foreground-muted/g' "$file"
  sed -i 's/placeholder-stone-400 dark:placeholder-stone-400/placeholder:text-foreground-muted/g' "$file"
  
  # Borders
  sed -i 's/border-gray-200 dark:border-gray-700/border-[var(--border)]/g' "$file"
  sed -i 's/border-gray-200 dark:border-gray-600/border-[var(--border)]/g' "$file"
  sed -i 's/border border-gray-200 dark:border-gray-700/border border-[var(--border)]/g' "$file"
  
  # Focus states
  sed -i 's/focus:ring-yellow-500/focus:ring-[var(--border-focus)]/g' "$file"
  sed -i 's/focus:ring-2 focus:ring-yellow-500/focus:ring-2 focus:ring-[var(--border-focus)]/g' "$file"
  
  # Error states
  sed -i 's/bg-red-50 dark:bg-red-900\/20/bg-error-light/g' "$file"
  sed -i 's/border-red-200 dark:border-red-800/border-error/g' "$file"
  sed -i 's/text-red-700 dark:text-red-300/text-foreground/g' "$file"
  sed -i 's/bg-red-100 dark:bg-red-900/bg-error-light/g' "$file"
  sed -i 's/text-red-800 dark:text-red-200/text-foreground/g' "$file"
  
  # Success states
  sed -i 's/bg-green-50 dark:bg-green-900\/20/bg-success-light/g' "$file"
  sed -i 's/border-green-200 dark:border-green-800/border-success/g' "$file"
  sed -i 's/text-green-700 dark:text-green-300/text-foreground/g' "$file"
  sed -i 's/text-green-600 dark:text-green-400/text-success/g' "$file"
  
  # Links
  sed -i 's/text-yellow-600 dark:text-yellow-500 hover:text-yellow-700 dark:hover:text-yellow-400/text-accent hover:text-accent-hover/g' "$file"
  sed -i 's/text-yellow-600 dark:text-yellow-400 hover:text-yellow-700 dark:hover:text-yellow-300/text-accent hover:text-accent-hover/g' "$file"
  
  # Accent text
  sed -i 's/text-blue-600 dark:text-blue-400/text-accent/g' "$file"
  
  echo "Updated: $file"
}

# Update remaining auth pages
update_file "src/app/auth/signup/page.tsx"
update_file "src/app/auth/forgot-password/page.tsx"
update_file "src/app/auth/reset-password/page.tsx"

# Update members pages
update_file "src/app/members/page.tsx"

# Update admin pages (expand as needed)
for file in src/app/admin/**/*.tsx; do
  if [ -f "$file" ]; then
    update_file "$file"
  fi
done

# Update legal pages  
update_file "src/app/legal-notice/page.tsx"
if [ -f "src/app/privacy/page.tsx" ]; then
  update_file "src/app/privacy/page.tsx"
fi

# Update components
update_file "src/components/contact-modal.tsx"

echo "=========================================="
echo "Migration complete! Review changes with:"
echo "git diff src/"
echo ""  
echo "If satisfied, commit. Otherwise restore:"
echo "rm -rf src && mv src.backup src"
echo "=========================================="

To use:

chmod +x migrate-colors.sh
./migrate-colors.sh
git diff  # Review changes
npm run dev  # Test
git add . && git commit -m "refactor: migrate to centralized theme system"

🎨 MANUAL REVIEW NEEDED

Some complex components may need manual review for:

  1. Conditional classes - May need special handling
  2. Dynamic colors - Check if they reference theme appropriately
  3. Hover states on cards - May have hover:border-yellow-500 → use hover:border-[var(--border-focus)]
  4. Badge colors - May need custom mapping (e.g., admin badges, status indicators)
  5. Shadows - Update dark:hover:shadow-lg to just hover:shadow-md (auto-handled)

🧪 TESTING CHECKLIST

After migration:


📊 IMPACT SUMMARY

Benefits Achieved:

Single source of truth - All colors in one place
Designer-friendly - Easy to update theme
Dark mode automatic - No more dark: prefixes
Consistent UX - Same look across entire site
Maintainable - Easy to change brand colors
Type-safe - CSS custom properties
Performance - Faster than runtime theme switching

Reduction in Code:


📞 NEXT STEPS

  1. Review completed work - Test current implementations
  2. Run automated script (above) or manually update remaining files
  3. Share designer schema - docs/THEME_SCHEMA_FOR_DESIGNER.md
  4. Get color values - Designer provides final colors
  5. Update globals.css - Apply designer colors
  6. Final testing - Comprehensive QA
  7. Deploy - Push to production!

Questions? Refer to: