@vivekcsein-logo
  • Home
  • About
  • Development

    • Web Development
    • Performance & Optimization
    • Backend & APIs
    • Authentication & Security

    Specialized

    • SEO & Ad Monetization
    • AR Experiences
    • Animation
    • Figma to Code
  • Articles
  • Projects
  • Marketplace
  • Contact
@vivekcsein-logo

A portfolio full stack developer with a passion for building scalable and high-performance web applications.

Explore

  • Home
  • About

Services

  • Web Development
  • Backend & APIs
  • Performance Optimization
  • Security & Authentication

Connect

  • Contact
  • Privacy
  • Terms
  • Home
  • About
  • Web Development
  • Backend & APIs
  • Performance Optimization
  • Security & Authentication
  • Contact
  • Privacy
  • Terms

© @vivekcsein. All rights reserved.

  • Home
  • All Articles47
  • Featured
  • Recently Added
  • Most Read
  • Bookmarks
Topics
  • Interview3
  • 3d4
  • Ai Prompts2
  • Business3
  • Deployment1
  • Dev2
  • Frontend5
  • Getting Started2
  • Security2
  • Seo2
  • Workflow10
    • Stage 1 — Project Initialization
    • Stage 2 — Professional Development Environment
    • Stage 3 — Enterprise Architecture
    • Stage 4 — Design System
    • Stage 5 — Design System Implementation
    • Stage 6 — Reusable UI Components
    • Stage 7 — Server-Only Icon System
    • Stage 8 — Project Environment Setup
    • Stage 9 — shadcn/ui Integration
    • Stage 10 — API Layer
  • Backend1
  • Deployment1
  • Security1
  • Javascript1
  • Client Advisory5
  • Engineering2
Collections
  • Docs
  • Tutorials
  • Resources
  • Articles
“A better developer every single day.”
— Vivek
  1. Docs
  2. Workflow
  3. Stage 5 — Design System Implementation
Workflow

Stage 5 — Design System Implementation

Implement the design system: CSS variables, next-themes, typography, spacing, radius and shadow scales, cn(), CVA variants and the first reusable UI components.

Updated Oct 2, 20263 min read
On this page

On this page

  • Overview
  • Objectives
  • 1. CSS Variables
  • 2. Theme Configuration
  • 3. Tailwind CSS Integration
  • 4. Typography System
  • 5. Spacing System
  • 6. Border Radius
  • 7. Shadow System
  • 8. Responsive Breakpoints
  • 9. Utility Functions
  • 10. Component Variants (CVA)
  • 11. Reusable UI Components
  • 12. Icons
  • 13. Animation Guidelines
  • 14. Accessibility
  • Design System Rules
  • Stage Deliverables
  • Design Philosophy

Overview#

Stage 4 defined the design system's contract. This stage implements it: CSS variables, theme wiring, typography, spacing, radius, shadows, breakpoints, and the first reusable UI components.

Objectives#

  • CSS variable system (light + dark)
  • Theme provider wired up with next-themes
  • Tailwind theme integration
  • Typography, spacing, radius, and shadow scales
  • Utility functions (cn() and friends)
  • Component variants with CVA
  • First reusable UI components

1. CSS Variables#

Define light and dark values for every semantic token from Stage 4 — background, foreground, primary, card, muted, destructive, border, input, ring, radius, plus any optional tokens the project needs — inside styles/globals.css.

2. Theme Configuration#

Wire up next-themes:

  • Default theme
  • System theme detection
  • Theme persistence
  • ThemeProvider in components/providers/ThemeProvider
  • A theme switcher component

3. Tailwind CSS Integration#

Configure Tailwind to consume the semantic tokens from Stage 4 as first-class utilities: semantic classes, theme-aware utilities, custom utilities, responsive variants.

4. Typography System#

TokenUsage
DisplayLanding pages
H1Main page title
H2Section title
H3Card title
H4Small section title
Body LargeMain content
BodyDefault text
SmallSecondary information
CaptionLabels

Define font families, sizes, weights, and line heights as utilities inside styles/typography.css.

5. Spacing System#

text
4px   8px   12px   16px   20px   24px   32px   40px   48px   64px

Avoid arbitrary spacing values unless no reasonable token fits.

6. Border Radius#

text
Small · Medium · Large · Extra Large · Full

Buttons, inputs, cards, dialogs, and modals all reuse these values — never a one-off radius.

7. Shadow System#

text
Shadow XS · Shadow SM · Shadow MD · Shadow LG · Shadow XL

Avoid hand-written box-shadow values in components.

8. Responsive Breakpoints#

DeviceWidth
Mobile<640px
Small640px
Medium768px
Large1024px
Extra Large1280px
2XL1536px

Design mobile-first; apply breakpoints consistently across the application.

9. Utility Functions#

typescript
// packages/utils/cn.ts
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";

export const cn = (...inputs: ClassValue[]) => twMerge(clsx(inputs));

10. Component Variants (CVA)#

text
Button
├── default
├── outline
├── ghost
├── destructive
└── link
text
Badge
├── default
├── success
├── warning
└── error

Use Class Variance Authority to manage variants — never duplicate a component to express a variant.

11. Reusable UI Components#

First components to build inside components/ui:

text
ui
├── button
│   └── Button.tsx
│
├── input
│   ├── Input.tsx
│   ├── Checkbox.tsx
│   ├── Select.tsx
│   ├── PasswordInput.tsx
│   └── InputFactory.tsx
│
└── shadcn

These stay presentation-only — no business logic, no data fetching, no feature-specific state.

12. Icons#

Single icon library: lucide-react. Tree-shakeable, consistent style, typed, lightweight. Don't mix icon families.

13. Animation Guidelines#

Shared animations live in styles/animations.css: fade in, fade out, scale, slide, accordion, skeleton loading. Keep timing consistent across components.

14. Accessibility#

Build it in, don't bolt it on:

  • Keyboard navigation
  • Visible focus states
  • Sufficient color contrast
  • Semantic HTML
  • ARIA attributes where needed
  • Screen reader compatibility

Design System Rules#

  • Never hardcode colors inside components.
  • Reuse design tokens.
  • Keep spacing consistent.
  • Prefer semantic color names.
  • Keep typography centralized.
  • Reuse component variants — don't duplicate implementations.
  • Build accessible components by default.

Stage Deliverables#

  • ✅ Light / Dark / System theme system, fully wired
  • ✅ Semantic CSS variables
  • ✅ Tailwind semantic utilities
  • ✅ Typography, spacing, radius, and shadow scales
  • ✅ Shared styling utilities
  • ✅ Reusable component variants (CVA)
  • ✅ Foundation UI components: Button, Input, Checkbox, Card, Badge, Dialog
  • ✅ Consistent, accessible design language

Design Philosophy#

The project follows a modern enterprise design system inspired by:

  • Shadcn UI
  • Frontend Skills
  • Taste Skills

The visual style should feel:

  • Minimal
  • Premium
  • Professional
  • Spacious
  • Accessible
  • Modern
  • Performance-first

Avoid decorative or flashy UI unless explicitly requested.


PreviousStage 4 — Design SystemNext Stage 6 — Reusable UI Components

Keep reading

  • Workflow

    Stage 4 — Design System

    The design-system contract: semantic tokens, light/dark/system themes, shadcn-compatible variables and how every token maps to a Tailwind utility.

    3 min read·Oct 2, 2026
  • Workflow

    Stage 9 — shadcn/ui Integration

    Integrate shadcn/ui into the project's architecture: components.json aliases, theme presets via ui.shadcn.com or tweakcn, safe diffs and generated-component rules.

    10 min read·Oct 2, 2026
  • Workflow

    Stage 1 — Project Initialization

    Create the Next.js app every later stage builds on: App Router, TypeScript, Tailwind CSS, Biome, Bun and Turbopack, verified and running locally.

    2 min read·Oct 2, 2026

On this page

  • Overview
  • Objectives
  • 1. CSS Variables
  • 2. Theme Configuration
  • 3. Tailwind CSS Integration
  • 4. Typography System
  • 5. Spacing System
  • 6. Border Radius
  • 7. Shadow System
  • 8. Responsive Breakpoints
  • 9. Utility Functions
  • 10. Component Variants (CVA)
  • 11. Reusable UI Components
  • 12. Icons
  • 13. Animation Guidelines
  • 14. Accessibility
  • Design System Rules
  • Stage Deliverables
  • Design Philosophy