Skip to content

Latest commit

Β 

History

History
506 lines (407 loc) Β· 13.9 KB

File metadata and controls

506 lines (407 loc) Β· 13.9 KB

🎨 CoderKP Portfolio - Design System

Design System Header

πŸ“‹ Overview

This design system documents the visual design language, UI patterns, and design principles used throughout the CoderKP Portfolio. It serves as a comprehensive guide for maintaining design consistency and implementing new features while preserving the professional, modern aesthetic.


🌈 Color Palette

Primary Colors

/* Core Brand Colors */
--primary-blue: #3B82F6      /* Main accent color */
--primary-purple: #8B5CF6    /* Secondary accent */
--primary-dark: #111827      /* Main background */
--primary-white: #FFFFFF     /* Text and highlights */

Extended Palette

/* Gray Scale */
--gray-50: #F9FAFB
--gray-100: #F3F4F6
--gray-200: #E5E7EB
--gray-300: #D1D5DB
--gray-400: #9CA3AF
--gray-500: #6B7280
--gray-600: #4B5563
--gray-700: #374151
--gray-800: #1F2937
--gray-900: #111827

/* Semantic Colors */
--success: #10B981    /* Green for positive actions */
--warning: #F59E0B    /* Amber for warnings */
--error: #EF4444      /* Red for errors/challenges */
--info: #3B82F6       /* Blue for information */

Note: The portfolio uses modern OKLCH color variables for all core colors, mapped to Tailwind CSS via the Tailwind config. This enables advanced color contrast, dark mode, and future-proofing.

CSS Variable Mapping

:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  /* ...other variables... */
}
.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  /* ...other variables... */
}
extend: {
  colors: {
    background: 'var(--background)',
    foreground: 'var(--foreground)',
    primary: 'var(--primary)',
    // ...other mappings...
  }
}

Gradient Combinations

/* Brand Gradients */
--gradient-primary: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%)
--gradient-dark: linear-gradient(135deg, #1F2937 0%, #111827 100%)
--gradient-accent: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%)
--gradient-success: linear-gradient(135deg, #10B981 0%, #059669 100%)

πŸ“ Typography System

Font Hierarchy

/* Font Weights */
--font-light: 300
--font-normal: 400
--font-medium: 500
--font-semibold: 600
--font-bold: 700
--font-extrabold: 800

/* Font Sizes (Responsive) */
--text-xs: 0.75rem      /* 12px */
--text-sm: 0.875rem     /* 14px */
--text-base: 1rem       /* 16px */
--text-lg: 1.125rem     /* 18px */
--text-xl: 1.25rem      /* 20px */
--text-2xl: 1.5rem      /* 24px */
--text-3xl: 1.875rem    /* 30px */
--text-4xl: 2.25rem     /* 36px */
--text-5xl: 3rem        /* 48px */
--text-6xl: 3.75rem     /* 60px */

Typography Usage

  • Hero Headlines: text-5xl md:text-6xl with gradient text
  • Section Headers: text-3xl md:text-4xl with medium weight
  • Component Titles: text-xl md:text-2xl with medium weight
  • Body Text: text-base with normal weight
  • Captions: text-sm with medium weight
  • Labels: text-sm with medium weight

πŸ— Layout & Spacing

Container System

/* Container Widths */
--container-sm: 640px     /* Small screens */
--container-md: 768px     /* Medium screens */
--container-lg: 1024px    /* Large screens */
--container-xl: 1280px    /* Extra large screens */
--container-2xl: 1536px   /* 2X large screens */

Spacing Scale

/* Spacing Units (based on 0.25rem = 4px) */
--space-1: 0.25rem    /* 4px */
--space-2: 0.5rem     /* 8px */
--space-3: 0.75rem    /* 12px */
--space-4: 1rem       /* 16px */
--space-5: 1.25rem    /* 20px */
--space-6: 1.5rem     /* 24px */
--space-8: 2rem       /* 32px */
--space-10: 2.5rem    /* 40px */
--space-12: 3rem      /* 48px */
--space-16: 4rem      /* 64px */
--space-20: 5rem      /* 80px */
--space-24: 6rem      /* 96px */

Grid System

  • Mobile: Single column layout with full-width components
  • Tablet: 2-column grid for cards and content
  • Desktop: 3-4 column grid for optimal content distribution
  • Content Maximum Width: max-w-6xl (1152px)

🎭 Component Patterns

Card Components

// Standard Card Pattern
interface CardProps {
  background: 'glass' | 'solid' | 'gradient'
  border: boolean
  shadow: 'sm' | 'md' | 'lg' | 'xl'
  hover: boolean
  padding: 'sm' | 'md' | 'lg'
}

// Glass Card (Most Common)
className="bg-gray-800/70 backdrop-blur-sm border border-gray-700 rounded-xl p-6"

// Solid Card
className="bg-gray-800 border border-gray-700 rounded-xl p-6"

// Gradient Card
className="bg-gradient-to-br from-gray-800 to-gray-900 border border-gray-700 rounded-xl p-6"

Button Variants

// Primary Button
className="bg-gradient-to-r from-blue-500 to-purple-600 text-white px-6 py-3 rounded-lg font-medium hover:from-blue-600 hover:to-purple-700 transition-all duration-300"

// Secondary Button
className="border border-blue-500 text-blue-400 px-6 py-3 rounded-lg font-medium hover:bg-blue-500 hover:text-white transition-all duration-300"

// Ghost Button
className="text-gray-300 px-6 py-3 rounded-lg font-medium hover:text-white hover:bg-gray-800 transition-all duration-300"

Icon Usage

  • Size Small: size={16} for inline icons
  • Size Medium: size={20} for cards and buttons
  • Size Large: size={24} for headers and emphasis
  • Color: Usually matches parent text color or uses accent colors

✨ Animation Guidelines

Motion Principles

// Standard Easing
transition={{ duration: 0.3, ease: "easeOut" }}

// Smooth Easing (longer animations)
transition={{ duration: 0.5, ease: [0.22, 1, 0.36, 1] }}

// Spring Animation
transition={{ type: "spring", stiffness: 300, damping: 30 }}

Common Animation Patterns

// Fade In from Bottom
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}

// Scale In
initial={{ opacity: 0, scale: 0.9 }}
animate={{ opacity: 1, scale: 1 }}

// Slide In from Left
initial={{ opacity: 0, x: -20 }}
animate={{ opacity: 1, x: 0 }}

// Stagger Children
transition={{ staggerChildren: 0.1 }}

Hover Effects

// Subtle Lift
whileHover={{ y: -2, scale: 1.01 }}

// Button Hover
whileHover={{ scale: 1.05 }}

// Card Hover
whileHover={{ y: -5, scale: 1.02 }}

πŸ“± Responsive Design

Breakpoint Strategy

/* Mobile First Approach */
/* xs: 0px - 479px (default) */
/* sm: 480px - 767px */
/* md: 768px - 1023px */
/* lg: 1024px - 1279px */
/* xl: 1280px - 1535px */
/* 2xl: 1536px+ */

Responsive Patterns

  • Navigation: Collapsible mobile menu β†’ horizontal desktop nav
  • Typography: Scale up font sizes on larger screens
  • Grid: 1 column β†’ 2 columns β†’ 3-4 columns
  • Spacing: Increase padding and margins on larger screens
  • Images: Responsive sizing with aspect ratio preservation

🌟 UI Patterns

Section Layout Pattern

// Standard Section Structure
<section className="py-20 px-4">
  <div className="max-w-6xl mx-auto">
    {/* Section Header */}
    <div className="text-center mb-16">
      <h2 className="text-4xl mb-4 bg-gradient-to-r from-blue-400 to-purple-400 bg-clip-text text-transparent">
        Section Title
      </h2>
      <p className="text-gray-400 max-w-2xl mx-auto">
        Section description
      </p>
    </div>
    
    {/* Section Content */}
    <div className="grid md:grid-cols-2 lg:grid-cols-3 gap-8">
      {/* Content items */}
    </div>
  </div>
</section>

Loading States

// Skeleton Loading
<div className="animate-pulse">
  <div className="h-4 bg-gray-700 rounded w-3/4 mb-2"></div>
  <div className="h-4 bg-gray-700 rounded w-1/2"></div>
</div>

// Spinner Loading
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500"></div>

Interactive States

  • Hover: Subtle lift and color transitions
  • Active: Slight scale down (0.98)
  • Focus: Blue outline with ring
  • Disabled: Reduced opacity (0.5) and no pointer events

🎯 Design Principles

Visual Hierarchy

  1. Size: Larger elements draw attention first
  2. Color: Bright colors (blue/purple) for important elements
  3. Contrast: Dark backgrounds with light text
  4. Spacing: White space to separate and group content
  5. Position: Top-left to bottom-right reading pattern

Consistency Guidelines

  • Spacing: Use multiples of 4px (Tailwind's spacing scale)
  • Border Radius: Consistent rounding (8px for cards, 6px for buttons)
  • Shadows: Subtle shadows for depth without overwhelming
  • Animations: Consistent timing and easing functions

Accessibility Standards

  • Color Contrast: Minimum 4.5:1 ratio for text
  • Focus Indicators: Visible focus states for keyboard navigation
  • Semantic HTML: Proper heading hierarchy and landmarks
  • Alt Text: Descriptive text for all images
  • Keyboard Navigation: Full functionality without mouse

πŸ”§ Implementation Guidelines

CSS Class Naming Convention

/* Component Structure */
.component-name { /* Base component styles */ }
.component-name__element { /* Child element styles */ }
.component-name--modifier { /* Variant styles */ }

/* Utility Classes */
.u-text-center { /* Utility classes prefixed with 'u-' */ }
.u-margin-bottom-lg { /* Descriptive utility names */ }

Component Props Pattern

interface ComponentProps {
  variant?: 'primary' | 'secondary' | 'ghost'
  size?: 'sm' | 'md' | 'lg'
  className?: string
  children: React.ReactNode
}

State Management Pattern

// Local State
const [isVisible, setIsVisible] = useState(false)

// Derived State
const isActive = useMemo(() => {
  return activeSection === sectionId
}, [activeSection, sectionId])

πŸ“Š Component Library

Core Components

  • Header: Navigation with responsive menu
  • Hero: Landing section with animated elements
  • About: Professional background showcase
  • Skills: Interactive technology display
  • Projects: Grid layout with detail routing
  • Contact: Form with validation and social links
  • Footer: Branding and navigation links

UI Components (ShadCN)

  • Button: Multiple variants and sizes
  • Card: Glass and solid variants
  • Input: Form fields with validation
  • Badge: Technology tags and labels
  • Avatar: Profile images with fallbacks
  • Tooltip: Contextual information display

Custom Components

  • ProjectDetail: Individual project showcase
  • ProjectDetailComponents: Reusable project sub-components
  • AdminDashboard: Content management interface

🌐 Browser Support

Target Browsers

  • Chrome: Latest 2 versions
  • Firefox: Latest 2 versions
  • Safari: Latest 2 versions
  • Edge: Latest 2 versions
  • Mobile Safari: iOS 14+
  • Chrome Mobile: Android 8+

Progressive Enhancement

  • Core Functionality: Works without JavaScript
  • Enhanced Experience: Animations and interactions with JavaScript
  • Fallbacks: Graceful degradation for older browsers

πŸš€ Performance Considerations

Optimization Strategies

  • Image Optimization: WebP format with fallbacks
  • Lazy Loading: Images and components loaded on demand
  • Code Splitting: Route-based code splitting
  • Animation Performance: Transform and opacity for 60fps
  • Bundle Size: Tree shaking and minimal dependencies

Loading Priorities

  1. Critical CSS: Above-the-fold styles inline
  2. Hero Content: Prioritized loading for immediate visibility
  3. Images: Lazy loaded with blur-up placeholders
  4. Non-critical JavaScript: Deferred loading

πŸ“ˆ Analytics & Metrics

Performance Metrics

  • Core Web Vitals: LCP, FID, CLS targets
  • Load Time: < 3 seconds on 3G
  • Bundle Size: < 250KB gzipped
  • Lighthouse Score: 90+ across all categories

User Experience Metrics

  • Bounce Rate: Monitor engagement
  • Time on Page: Track section interaction
  • Conversion Rate: Contact form submissions
  • Device Breakdown: Mobile vs Desktop usage

πŸ”„ Maintenance Guidelines

Design Updates

  1. Test changes across all breakpoints
  2. Verify accessibility compliance
  3. Update documentation for new patterns
  4. Maintain consistency with existing design
  5. Performance impact assessment

Version Control

  • Design tokens in CSS variables
  • Component versioning for breaking changes
  • Documentation updates with each release
  • Visual regression testing for UI changes

πŸ“‹ Design Checklist

Before Implementation

  • Responsive design across all breakpoints
  • Accessibility compliance (WCAG 2.1 AA)
  • Performance optimization
  • Browser compatibility testing
  • Documentation updates

Quality Assurance

  • Visual consistency with design system
  • Interaction patterns match guidelines
  • Animation performance (60fps)
  • Error state handling
  • Loading state implementation

🎨 Design Tools & Resources

Design Assets

  • Color Palettes: Generated from brand colors
  • Typography Scale: Modular scale based on 16px base
  • Icons: Lucide React icon library
  • Images: Unsplash for high-quality stock photos
  • Patterns: Custom SVG patterns and backgrounds

Development Tools

  • Tailwind CSS: Utility-first CSS framework
  • Motion: Animation library for React
  • TypeScript: Type safety and developer experience
  • ShadCN/UI: Component library foundation

πŸ“ Design System maintained by: CoderKP
πŸ”„ Last updated: January 21, 2025
πŸ“Š Version: 2.0
🎯 Status: Production Ready βœ…


This design system is a living document that evolves with the portfolio. Regular updates ensure consistency and maintainability as new features are added.