This document outlines the design philosophy, visual identity, and architectural patterns used in the TokenUsage renderer.
TokenUsage follows a "Modern Developer Tool" aesthetic, prioritizing high information density, professional dark/light modes, and clear semantic feedback.
The project uses the Amber Gold (HappyCode) palette as its primary accent.
| Role | Dark Mode (#0f0f11) |
Light Mode (#fafafa) |
|---|---|---|
| Accent | #f0b429 (Amber) |
#c27a0e (Deep Amber) |
| Surface | #1a1a1f (Elevated) |
#ffffff (White) |
| Border | #2e2b1a (Subtle) |
#e2e2e8 (Soft Gray) |
| Success | #3dd68c |
#16a34a |
| Warning | #f59e0b |
#c48a00 |
| Danger | #f87171 |
#dc2626 |
- Interface:
-apple-system,Inter,Segoe UI. - Data/Code:
SF Mono,JetBrains Mono. - Feature: Extensive use of
font-variant-numeric: tabular-numsfor financial and token data to ensure perfect vertical alignment in lists and tables.
The UI is built using a Composition-over-Inheritance approach with React.
- Sidebar: Fixed width (200px), contains global navigation and a scrollable project list.
- Main Content: Flexible area with standard padding (
var(--space-lg)).
- Panel: A container with a top-accent border and standard rounding (
10px). Used to group related data. - KpiCard: High-level metric display with an optional Sparkline for trend visualization.
- StatCell: A compact label-value pair for secondary metrics.
- Hover Lift: Interactive cards use a subtle vertical translation and shadow expansion (
.hover-lift) to indicate clickability. - Clickable Scale: Buttons and links use a slight scale-down effect (
0.96) on active press to simulate physical feedback.
- Transitions: Standardized "Spring" animations for layout changes and "Fast" transitions for color/opacity shifts.
- Entry: Pages use a
fade-inanimation (upwards translation + opacity) to feel "alive" when navigating.
- High Signal-to-Noise: Use muted colors for secondary labels and high contrast for primary data.
- Immediate Feedback: Every action (refresh, navigation, copy) must have a visual or motion-based response.
- Density without Clutter: Use consistent spacing scales (
var(--space-*)) to maintain a breathable layout even with large amounts of data.
- Iconography: Replace text-based characters (⬡, ⚙) with a custom SVG icon set (e.g., Lucide).
- Data Viz: Expand Sparklines into full-featured interactive charts for deep-dive analysis.
- Responsive Breakpoints: Implement more robust grid wrapping for smaller Electron window sizes.