Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Design System Master File

LOGIC: When building a specific page, first check design-system/pages/[page-name].md. If that file exists, its rules override this Master file. If not, strictly follow the rules below.


Project: Zalo Rust Desktop Generated: 2026-10-21 19:23:18 Category: Chat & Messaging App Design Dials: Variance 4/10 (Balanced / Modern) | Motion 3/10 (Subtle) | Density 7/10 (Standard)


Global Rules

Color Palette

RoleHexCSS Variable
Primary#2563EB--color-primary
On Primary#FFFFFF--color-on-primary
Secondary#6366F1--color-secondary
On Secondary#000000--color-on-secondary
Accent/CTA#059669--color-accent
On Accent/CTA#000000--color-on-accent
Background#FFFFFF--color-background
Foreground#0F172A--color-foreground
Card#FFFFFF--color-card
Card Foreground#0F172A--color-card-foreground
Muted#F1F5FD--color-muted
Muted Foreground#475569--color-muted-foreground
Border#E4ECFC--color-border
Destructive#DC2626--color-destructive
On Destructive#FFFFFF--color-on-destructive
Ring#2563EB--color-ring

Color Notes: Messenger blue + online green

Typography

  • Heading Font: Inter
  • Body Font: Inter
  • Mood: minimal, clean, swiss, functional, neutral, professional
  • Google Fonts: Inter + Inter

CSS Import:

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

Spacing Variables

Density: 7/10 — Standard

TokenValueUsage
--space-xs4px / 0.25remTight gaps
--space-sm8px / 0.5remIcon gaps, inline spacing
--space-md16px / 1remStandard padding
--space-lg24px / 1.5remSection padding
--space-xl32px / 2remLarge gaps
--space-2xl48px / 3remSection margins
--space-3xl64px / 4remHero padding

Shadow Depths

LevelValueUsage
--shadow-sm0 1px 2px rgba(0,0,0,0.05)Subtle lift
--shadow-md0 4px 6px rgba(0,0,0,0.1)Cards, buttons
--shadow-lg0 10px 15px rgba(0,0,0,0.1)Modals, dropdowns
--shadow-xl0 20px 25px rgba(0,0,0,0.15)Hero images, featured cards

Component Specs

Buttons

/* Primary Button */
.btn-primary {
  background: #059669;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 200ms ease;
  cursor: pointer;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Secondary Button */
.btn-secondary {
  background: transparent;
  color: #2563eb;
  border: 2px solid #2563eb;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 200ms ease;
  cursor: pointer;
}

Cards

.card {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: all 200ms ease;
  cursor: pointer;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

Inputs

.input {
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 200ms ease;
}

.input:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px #2563eb20;
}

Modals

.modal-overlay {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal {
  background: white;
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow-xl);
  max-width: 500px;
  width: 90%;
}

Style Guidelines

Style: Minimalism & Swiss Style

Keywords: Clean, simple, spacious, functional, white space, high contrast, geometric, sans-serif, grid-based, essential

Best For: Enterprise apps, dashboards, documentation sites, SaaS platforms, professional tools

Key Effects: Subtle hover (200-250ms), smooth transitions, sharp shadows if any, clear type hierarchy, fast loading

Page Pattern

Pattern Name: Product Demo + Features

  • Conversion Strategy: Use an interactive demo only when it explains value better than static media. Provide captions, transcript, visible play/pause controls, and a non-video fallback; do not autoplay under reduced motion. Pause media when offscreen or hidden and keep the final product state available as static content.
  • CTA Placement: Video center + CTA right/bottom
  • Section Order: Hero > Product video/mockup (center) > Feature breakdown per section > Comparison (optional) > CTA

Motion

Scroll Reveal (Subtle) — Trigger: scroll (viewport enter) | Duration: 300-400ms | Easing: power1.out

gsap.from(el, {
  opacity: 0,
  y: 12,
  duration: 0.35,
  ease: "power1.out",
  scrollTrigger: { trigger: el, start: "top 90%", toggleActions: "play none none reverse" },
});

Framework notes: Requires the ScrollTrigger plugin registered once via gsap.registerPlugin(ScrollTrigger); Use matchMedia(‘(prefers-reduced-motion: reduce)’) to skip non-essential motion and render the final state immediately

  • ✅ Keep the y offset small (8-16px) so it reads as a fade, not a slide
  • ❌ Don’t reveal below-the-fold content needed for SEO/crawlers as invisible-by-default without a no-JS fallback
  • ⚡ toggleActions ‘play none none reverse’ avoids re-triggering on every scroll direction change

Anti-Patterns (Do NOT Use)

  • ❌ Excessive decoration

Additional Forbidden Patterns

  • ❌ Emojis as icons — Strictly use lucide::... icon constants. Never use raw keyboard emojis as UI icons (prevents missing-glyph tofu boxes □).
  • ❌ Missing cursor:pointer — All clickable elements must have cursor:pointer
  • ❌ Layout-shifting hovers — Avoid scale transforms that shift layout
  • ❌ Low contrast text — Maintain 4.5:1 minimum contrast ratio
  • ❌ Instant state changes — Always use transitions (150-300ms)
  • ❌ Invisible focus states — Focus states must be visible for a11y

Pre-Delivery Checklist

Before delivering any UI code, verify:

  • Strictly use lucide::... icon constants, never raw keyboard emojis.
  • All icons from embedded Lucide vector set (src/gui/theme.rs).
  • cursor-pointer on all clickable elements
  • Hover states with smooth transitions (150-300ms)
  • Light mode: text contrast 4.5:1 minimum
  • Focus states visible for keyboard navigation
  • prefers-reduced-motion respected
  • Responsive: 375px, 768px, 1024px, 1440px
  • No content hidden behind fixed navbars
  • No horizontal scroll on mobile