Design System
CSS variables, color palette, typography, components, and visual language for Matrix OS apps.
Matrix OS has a warm, organic visual language built on CSS custom properties. Every app -- whether a single HTML file or a full React project -- uses the same design tokens to stay cohesive with the desktop shell.
Philosophy
Matrix OS is not a cold developer tool. The palette draws from natural materials: terracotta accents, lavender backgrounds, warm blacks. Glass-morphism and subtle blur create depth without heaviness. The aesthetic is warm, approachable, and refined.
CSS Variables
The shell injects --matrix-* variables into app iframes via the OS bridge. Apps that reference these variables automatically adapt when the user changes their theme.
Core Colors
| Variable | Default | Usage |
|---|---|---|
--matrix-bg | #ece5f0 | Page/canvas background (lavender) |
--matrix-fg | #1c1917 | Primary text (warm black) |
--matrix-card | #ffffff | Card/panel surfaces |
--matrix-card-fg | #1c1917 | Text on cards |
--matrix-primary | #c2703a | Primary accent (terracotta) |
--matrix-primary-fg | #ffffff | Text on primary elements |
--matrix-secondary | #f0eaf4 | Secondary surfaces |
--matrix-secondary-fg | #44403c | Text on secondary |
--matrix-muted | #f0eaf4 | Muted/subtle backgrounds |
--matrix-muted-fg | #78716c | De-emphasized text |
--matrix-border | #d8d0de | Borders and dividers |
--matrix-input | #d8d0de | Input field borders |
--matrix-ring | #c2703a | Focus ring color |
--matrix-accent | #f0eaf4 | Hover/highlight backgrounds |
--matrix-accent-fg | #44403c | Text on accent |
Semantic Colors
| Variable | Default | Usage |
|---|---|---|
--matrix-destructive | #ef4444 | Errors, delete actions |
--matrix-success | #22c55e | Positive states |
--matrix-warning | #eab308 | Warnings |
Typography and Radius
| Variable | Default | Usage |
|---|---|---|
--matrix-font-sans | "Inter", system-ui, sans-serif | Body text |
--matrix-font-mono | "JetBrains Mono", monospace | Code, data |
--matrix-radius | 0.75rem | Base border-radius |
Color Palette
The palette is warm and organic:
- Background: Lavender
#ece5f0-- the canvas everything floats on - Primary: Terracotta
#c2703a-- the signature accent, used for buttons, links, and focus rings - Foreground: Warm black
#1c1917-- softer than pure black, matching the organic feel - Cards: White
#ffffff-- clean surfaces with subtle shadow for depth - Border: Lavender tint
#d8d0de-- barely visible structure
Surface Hierarchy
Three levels of elevation:
- Background (
--matrix-bg): The lowest surface. Lavender canvas. - Card (
--matrix-card): Content panels with subtle shadow. - Elevated (
--matrix-popover): Floating elements with backdrop blur and pronounced shadow.
Typography
Scale
| Name | Size | Weight | Usage |
|---|---|---|---|
text-xs | 12px | 400 | Timestamps, metadata |
text-sm | 14px | 400-500 | Labels, secondary text |
text-base | 16px | 400 | Body text |
text-lg | 18px | 500 | Card titles |
text-xl | 20px | 600 | Section subheadings |
text-2xl | 24px | 600-700 | Section headings |
text-3xl | 30px | 700 | Page headings |
Font Choices
The shell uses Inter for UI text and JetBrains Mono for code. Apps should inherit via var(--matrix-font-sans) rather than redeclaring fonts.
For display headings in standalone apps, distinctive alternatives are encouraged: DM Serif Display, Space Grotesk, Sora, Fraunces, or Outfit.
Banned fonts
Do not use Inter, Roboto, Arial, Helvetica, or Open Sans as deliberate font choices in apps. These produce generic, undifferentiated UI. Inherit the OS font or choose something distinctive.
Spacing
All spacing follows a 4px grid:
| Token | Value | Usage |
|---|---|---|
xs | 4px | Icon-to-label gaps, badge padding |
sm | 8px | Between related elements, input padding |
md | 16px | Card padding, section spacing |
lg | 24px | Between cards, section padding |
xl | 32px | Page margins, major sections |
2xl | 48px | Hero spacing |
Component Patterns
Buttons
/* Primary */
background: var(--matrix-primary);
color: var(--matrix-primary-fg);
border-radius: var(--matrix-radius-md);
padding: 8px 20px;
font-weight: 600;
/* Secondary */
background: transparent;
border: 1px solid var(--matrix-border);
color: var(--matrix-fg);
/* Ghost */
background: transparent;
color: var(--matrix-fg);
/* hover: background: var(--matrix-accent) */
/* Destructive */
background: var(--matrix-destructive);
color: #ffffff;Cards
.card {
background: var(--matrix-card);
border: 1px solid var(--matrix-border);
border-radius: var(--matrix-radius-lg);
padding: 16px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}Glass-morphism
For floating elements:
background: rgba(255, 255, 255, 0.8);
backdrop-filter: blur(8px);
border: 1px solid var(--matrix-border);
border-radius: var(--matrix-radius-xl);Empty States
Every view must handle zero items:
<div style="text-align: center; padding: 48px 24px;">
<svg><!-- icon --></svg>
<h3>No items yet</h3>
<p>Get started by creating your first item.</p>
<button>Create Item</button>
</div>Animation
| Type | Duration | Easing |
|---|---|---|
| Micro (button, toggle) | 100ms | ease-out |
| Enter (panel, tooltip) | 150ms | ease-out |
| Exit (dismiss) | 100ms | ease-in |
| Move (reposition) | 200-300ms | ease-in-out |
Only animate transform and opacity. Always respect prefers-reduced-motion.
Orchestrated Page Load
Stagger child element entrances:
.card { animation: fadeUp 0.3s ease-out backwards; }
.card:nth-child(1) { animation-delay: 0ms; }
.card:nth-child(2) { animation-delay: 60ms; }
.card:nth-child(3) { animation-delay: 120ms; }
@keyframes fadeUp {
from { opacity: 0; transform: translateY(12px); }
to { opacity: 1; transform: translateY(0); }
}@matrix-os/ui Package
The @matrix-os/ui package provides themed React components for Vite apps:
import { Button, Card, CardContent, Input, Badge, Dialog } from '@matrix-os/ui';
import '@matrix-os/ui/styles.css';Components use --matrix-* CSS variables and accept className and style props for customization. They are lightweight (no Radix dependency) and React 19 compatible.
Available Components
| Component | Description |
|---|---|
Button | Primary, secondary, ghost, destructive variants |
Card, CardHeader, CardTitle, CardContent, CardFooter | Card container with sections |
Input | Text input with label and error state |
Dialog, DialogTitle, DialogFooter | Modal dialog with overlay |
Badge | Status badge (default, success, warning, error) |
Tooltip | Hover tooltip with configurable position |
AI Design Resources
The AI uses two files when building UI:
- Knowledge file:
~/agents/knowledge/matrix-design-system.md-- full CSS variable reference, patterns, and anti-patterns - Skill:
~/agents/skills/design-matrix-frontend.md-- design thinking process, aesthetic direction, quality checklist
Both are loaded automatically when the AI builds apps, ensuring consistent visual output.
How is this guide?
