@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 4 — Design System
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.

Updated Oct 2, 20263 min read
On this page

On this page

  • Overview
  • Objectives
  • Check Installed Dependencies
  • Design Philosophy
  • Design Tokens
  • Theme Configuration
  • Semantic Theme Variables
  • Tailwind CSS Compatibility
  • Global CSS Architecture
  • Component Guidelines
  • Color Usage
  • Stage Deliverables
  • Next Stage

Overview#

A design system is the single source of truth for how the interface looks and behaves. Instead of styling components individually, the project defines tokens, themes, typography, spacing, and reusable patterns that every feature follows — consistent by construction, not by discipline.

This stage defines the contract: what the tokens are and how they map to Tailwind. Stage 5 implements it.

Objectives#

  • Design tokens
  • Theme system (light / dark / system)
  • shadcn/ui compatible variables
  • Tailwind CSS compatible theme
  • Global CSS architecture
  • Component guidelines

Check Installed Dependencies#

bash
bun add class-variance-authority tailwind-merge next-themes clsx lucide-react

Design Philosophy#

  • Consistency over customization
  • Reusable UI components
  • Accessibility by default
  • Mobile-first, responsive layouts
  • Theme-aware components
  • Semantic color tokens
  • Predictable spacing
  • Scalable typography

Design Tokens#

Centralize every visual value instead of hardcoding it inside components:

  • Colors
  • Typography
  • Spacing
  • Border radius
  • Shadows
  • Z-index
  • Animation durations

Theme Configuration#

Three modes: Light, Dark, System — powered by next-themes.

WhatWhere
Theme configurationpackages/configs/theme.config.ts
Style configurationpackages/configs/styles.config.ts

No component defines its own color palette.

Semantic Theme Variables#

The project follows the shadcn/ui semantic color system. Components reference tokens, never raw color values.

Foundation — background, foreground, border, input, ring, radius

Surface — card, card-foreground, popover, popover-foreground

Brand — primary, primary-foreground, secondary, secondary-foreground, accent, accent-foreground

Utility — muted, muted-foreground

Feedback — destructive, destructive-foreground

Optional (larger applications) — success / warning / info pairs, chart-1 through chart-5, sidebar tokens

Tailwind CSS Compatibility#

Every semantic token maps to a Tailwind utility:

Theme TokenTailwind Utility
backgroundbg-background
foregroundtext-foreground
primarybg-primary
primary-foregroundtext-primary-foreground
secondarybg-secondary
secondary-foregroundtext-secondary-foreground
accentbg-accent
accent-foregroundtext-accent-foreground
cardbg-card
card-foregroundtext-card-foreground
popoverbg-popover
popover-foregroundtext-popover-foreground
mutedbg-muted
muted-foregroundtext-muted-foreground
destructivebg-destructive
destructive-foregroundtext-destructive-foreground
borderborder-border
inputborder-input
ringring-ring

Global CSS Architecture#

text
├── styles
│   ├── themes
|        ├── cyantrix-theme.css
|        ├── cosmic-night.css
│   ├── utils
|        ├── app.css
|        ├── fonts.css
|        ├── theme.css
|        ├── animations.css
|        ├── typography.css
│   ├── ui
|        ├── input.css
|        ├── button.css
|        ├── navigation.css
│   ├── globals.css
FileResponsibility
globals.cssCSS Imports
theme.cssCSS Variables compatible to shadcn
typography.cssReset & Typography utilities
input.cssShared input styles
app.cssShared app utilities
animations.cssCommon animations
navigation.cssNavigation-specific themes

Component Guidelines#

Reusable UI lives in components/ui. Business-specific components live in components/features.

Every reusable component should:

  • Use semantic theme variables
  • Support light and dark themes
  • Reuse existing UI primitives
  • Avoid inline styles and hardcoded colors
  • Support accessibility
  • Expose variants with CVA where relevant

Color Usage#

✅ Preferred

tsx
className = "bg-primary text-primary-foreground";
className = "bg-card text-card-foreground";
className = "bg-muted text-muted-foreground";
className = "border-border";
className = "focus-visible:ring-ring";

❌ Avoid

tsx
className = "bg-blue-600";
className = "bg-white";
className = "text-gray-500";
className = "border-gray-300";

Stage Deliverables#

  • ✅ Semantic design tokens
  • ✅ Light / Dark / System themes
  • ✅ shadcn/ui compatible variables
  • ✅ Tailwind CSS compatible theme
  • ✅ Global CSS architecture
  • ✅ Component guidelines

Next Stage#

Continue to Stage 5 — Design System Implementation to implement the tokens, typography, spacing, and component variants defined here.

PreviousStage 3 — Enterprise ArchitectureNext Stage 5 — Design System Implementation

Keep reading

  • 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 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.

    3 min read·Oct 2, 2026
  • Workflow

    Stage 6 — Reusable UI Components

    The rulebook for reusing, extending or creating UI components: Button, InputFactory, Link, IconSVG, LucideIcon and shadcn, with a decision tree.

    4 min read·Oct 2, 2026

On this page

  • Overview
  • Objectives
  • Check Installed Dependencies
  • Design Philosophy
  • Design Tokens
  • Theme Configuration
  • Semantic Theme Variables
  • Tailwind CSS Compatibility
  • Global CSS Architecture
  • Component Guidelines
  • Color Usage
  • Stage Deliverables
  • Next Stage