Matrix OSMatrix OS
Guide

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

VariableDefaultUsage
--matrix-bg#ece5f0Page/canvas background (lavender)
--matrix-fg#1c1917Primary text (warm black)
--matrix-card#ffffffCard/panel surfaces
--matrix-card-fg#1c1917Text on cards
--matrix-primary#c2703aPrimary accent (terracotta)
--matrix-primary-fg#ffffffText on primary elements
--matrix-secondary#f0eaf4Secondary surfaces
--matrix-secondary-fg#44403cText on secondary
--matrix-muted#f0eaf4Muted/subtle backgrounds
--matrix-muted-fg#78716cDe-emphasized text
--matrix-border#d8d0deBorders and dividers
--matrix-input#d8d0deInput field borders
--matrix-ring#c2703aFocus ring color
--matrix-accent#f0eaf4Hover/highlight backgrounds
--matrix-accent-fg#44403cText on accent

Semantic Colors

VariableDefaultUsage
--matrix-destructive#ef4444Errors, delete actions
--matrix-success#22c55ePositive states
--matrix-warning#eab308Warnings

Typography and Radius

VariableDefaultUsage
--matrix-font-sans"Inter", system-ui, sans-serifBody text
--matrix-font-mono"JetBrains Mono", monospaceCode, data
--matrix-radius0.75remBase 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:

  1. Background (--matrix-bg): The lowest surface. Lavender canvas.
  2. Card (--matrix-card): Content panels with subtle shadow.
  3. Elevated (--matrix-popover): Floating elements with backdrop blur and pronounced shadow.

Typography

Scale

NameSizeWeightUsage
text-xs12px400Timestamps, metadata
text-sm14px400-500Labels, secondary text
text-base16px400Body text
text-lg18px500Card titles
text-xl20px600Section subheadings
text-2xl24px600-700Section headings
text-3xl30px700Page 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:

TokenValueUsage
xs4pxIcon-to-label gaps, badge padding
sm8pxBetween related elements, input padding
md16pxCard padding, section spacing
lg24pxBetween cards, section padding
xl32pxPage margins, major sections
2xl48pxHero 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

TypeDurationEasing
Micro (button, toggle)100msease-out
Enter (panel, tooltip)150msease-out
Exit (dismiss)100msease-in
Move (reposition)200-300msease-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

ComponentDescription
ButtonPrimary, secondary, ghost, destructive variants
Card, CardHeader, CardTitle, CardContent, CardFooterCard container with sections
InputText input with label and error state
Dialog, DialogTitle, DialogFooterModal dialog with overlay
BadgeStatus badge (default, success, warning, error)
TooltipHover 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?

On this page