Overview
Paper UI requires custom Tailwind configuration to support:- Semantic color tokens (Ink, Paper, Surface, Accent)
- Hard shadows (4px 4px 0px 0px)
- Typography system (Serif, Sans-Serif, Monospace)
- Border radius constraints (max 2px)
- Dark mode support
Recommended Approach: CSS Custom Properties
The recommended approach uses CSS custom properties for better dark mode support and easier theme management.HTML Setup
Tailwind CDN Configuration
For CDN-based setups (current MetaCogna.ai Landing approach):Standard Tailwind Config File Approach
For projects using standard Tailwind configuration files:tailwind.config.js
CSS File (e.g., src/index.css or styles.css)
Color System
Paper UI Color Tokens
| Token | Light Mode | Dark Mode | Usage |
|---|---|---|---|
| Ink | #18181b (Zinc 900) | #f4f4f5 (Zinc 100) | Primary text, borders, shadows |
| Paper | #ffffff (White) | #18181b (Zinc 900) | Cards, modals, backgrounds |
| Surface | #f4f4f5 (Zinc 100) | #09090b (Zinc 950) | Background/desk surface |
| Accent | #10b981 (Emerald 500) | #34d399 (Emerald 400) | Success, highlights, links |
| Warning | #ef4444 (Red 500) | #f87171 (Red 400) | Errors, delete actions |
Additional Accent Variants
Typography
Font Families
Paper UI uses three distinct typefaces:Font Loading
Include in HTML<head>:
Shadows
Hard Shadows
Paper UI uses hard, non-blurred shadows to create physical depth:shadow-hard:4px 4px 0px 0px rgb(var(--color-shadow))- Default card shadowshadow-hard-sm:2px 2px 0px 0px rgb(var(--color-shadow))- Small elementsshadow-hard-lg:6px 6px 0px 0px rgb(var(--color-shadow))- Hover statesshadow-hard-hover:6px 6px 0px 0px rgb(var(--color-shadow))- Interactive hover
Usage
Border Radius
Paper UI uses minimal border radius (max 2px) for “hard edges”:Animations
Custom Animations (Optional)
Dark Mode Setup
Toggle Implementation
CSS Background Pattern
Optional dot pattern background:Migration Guide
From Direct Color Values
Before:From Standard Shadows
Before:Adding Dark Mode
- Add CSS custom properties for dark mode
- Configure
darkMode: 'class'in Tailwind config - Use semantic color tokens instead of direct colors
- Test all components in both light and dark modes
Current Application Status
MetaCogna RAG
- Status: Uses CDN Tailwind with inline config
- Dark Mode: Not implemented
- Migration: Needs CSS custom properties approach
MetaCogna.ai Landing
- Status: Uses CDN Tailwind with CSS custom properties ✅
- Dark Mode: Fully implemented ✅
- Migration: Already follows recommended approach
Parti Architecture
- Status: Uses CDN Tailwind with basic config
- Dark Mode: Unknown
- Migration: Needs CSS custom properties and dark mode
Best Practices
- Always use semantic tokens:
bg-paper,text-ink,border-ink - Never use direct colors: Avoid
bg-white,text-zinc-900 - Test dark mode: Ensure all components work in both themes
- Use CSS custom properties: Best approach for theme switching
- Consistent shadows: Always use
shadow-hardvariants - Minimal border radius: Max 2px except for circles
Related Documentation
- Design System - Paper UI design principles
- Component Guide - Component usage
- Baseline Components - Standardized components