How to Fix Claude Code's CSS Guesswork with a Design System

A developer building a stock analysis dashboard with Claude Code encountered a common frustration: the AI repeatedly generated broken CSS for the same misaligned div. Over six iterations, attempts to fix padding, switch from flex to grid, and add overflow: hidden either failed or made the problem worse.
The Problem: AI Designing Blind
The developer realized Claude Code has no visual feedback—it can't see browser output. It pattern-matches from descriptions and guesses at styling, often producing "technically valid CSS that looks like it was designed by someone who has never used a computer."
The Solution: Constrain with a Design System
Instead of giving tokens, provide a complete design system specification. The developer used:
/* spacing */ --space-xs: 4px; --space-sm: 8px; --space-md: 16px; --space-lg: 32px;/* colors */ --bg-primary: #0f1117; --bg-card: #1a1d27; --accent: #3b82f6; --text-primary: #e2e8f0; --text-muted: #64748b;
/* type scale */ --text-sm: 12px; --text-base: 14px; --text-lg: 18px; --text-xl: 24px;
Then instruct: "Use only these values. No hardcoded numbers anywhere." This gives Claude a framework to reason from rather than a blank canvas for arbitrary decisions.
Separate Structure and Style Prompts
Never ask Claude to write HTML and CSS simultaneously. The developer split the process:
- First prompt: "Generate only the HTML structure for this dashboard. No style attributes, no CSS, no classes yet. Just semantic structure."
- Second prompt: "Now write the CSS for this structure using only the design system above."
This forces Claude to treat the HTML as a fixed contract before applying styles, preventing it from losing track of assumptions about its own output.
The result: the next component went from six iterations to one. The developer also raised the question of whether this design system could be enforced via a CLAUDE.md file to avoid pasting it every session.
📖 Read the full source: r/ClaudeAI
👀 See Also
Stop OpenClaw from Spawning Multiple Local LLM Instances on LM Studio
User reports OpenClaw spawning duplicate local LLM instances (Qwen 3.5 9B via LM Studio) on a 16GB Mac Mini M1, causing timeouts and resource exhaustion. Seeks a way to force single-instance queuing.

Workaround for Control UI assets error after OpenClaw 2026.3.22 upgrade
A user posted a solution for the 'Control UI assets not found' error that occurs after upgrading to OpenClaw 2026.3.22, involving copying the control-ui folder from a beta installation to the stable release.

Writing Effective SOUL.md Files for AI Coding Agents
A Reddit post from r/openclaw demonstrates the difference between vague and specific SOUL.md instructions, showing that specific prompts yield more useful AI agent behavior.

Workaround for Claude Mobile App Microphone Feedback Loop Error
A Reddit user shares a working workaround for the microphone feedback loop error in the Claude mobile app: installing the web version as a standalone Progressive Web App via Google Chrome, which bypasses the issue and provides access to different Claude models.