I Described a Hardware UI Into Existence

Building a skeuomorphic studio interface in pure CSS and SVG with zero reference images—just verbal physics prompts and iterative CSS.

TypeStaxJuly 20266 min read

Ask a designer why coding agents struggle with visual craft and you will hear two common explanations: the model lacks taste, and it defaults to generic patterns. Both are true, and neither was the primary bottleneck when I tested pure verbal UI direction across an eight-day build.

When I look at a rendered UI in the browser, I can spot a visual imbalance in half a second. Translating what my eye caught into a precise, unambiguous sentence that a coding agent can execute takes closer to two minutes. That translation gap is where the real work sits.

I have written CSS since 2004 and transitioned full-time into product design around 2016. While I can still style a surface by hand, modern front-end state machinery (AST transforms, font-metric parsers, spring physics loops) is much faster to build with an AI coding partner. I wanted to test whether I could direct the entire visual layer of an application through text prompts alone, holding the output to the exact standard I use when writing CSS by hand.

The test project was TypeStax, a web tool for building typographic scales and testing font pairings. I chose a 1980s studio hardware aesthetic: rotary knobs, recessed slider tracks, corner hex bolts, surface grain, and beveled seams between rack-mounted modules. Every highlight, shadow, and texture had to be rendered in pure CSS and inline SVG. And I set one strict constraint before starting: zero reference images. No screenshots, no Dribbble boards, and no Figma frames pasted into the prompt.

TypeStax interface rendered entirely in CSS and inline SVG: rotary knobs, embossed slider caps, VU contrast meters, and corner bolts
TypeStax rendered in pure CSS and SVG

Why ban reference images? Handing a vision model a screenshot lets it approximate pixel regions without requiring you to articulate why the layout works. Removing images forces every visual decision to become an explicit structural rule.

1. Prompt in physical mechanics and light direction

Prompting "make it feel like hardware" produces a rounded rectangle with a generic drop shadow. Prompting "a 3px horizontal channel pressed into the panel, lit from straight above" produces the exact CSS shadow stack on the first try, because overhead light hitting a recessed groove maps directly to linear-gradient and box-shadow declarations.

The horizontal seam between rack modules (.module-groove) came directly from that physical description:

.module-groove {
  height: 3px;
  background: linear-gradient(to bottom,
    oklch(0.85 0.003 80) 0%,
    oklch(0.96 0.003 80) 100%
  );
  box-shadow:
    inset 0 1px 2px oklch(0 0 0 / 12%),
    0 1px 0 oklch(1 0 0 / 50%);
}

Because light comes from above, the upper wall of a recessed groove sits in shadow (0.85 lightness) while the lower wall catches the light (0.96 lightness), and a 1px white drop shadow along the bottom lip catches the specular edge. Once we defined .module-groove, I could say “insert a module groove between these two panels” and reuse the physical primitive everywhere.

The tactile hardware buttons (.hw-btn) use the same optical model. At rest, each button face runs a 6% lightness gradient from oklch(0.95) at the top to oklch(0.89) at the bottom so the cap reads as slightly convex, supported by five layered box-shadow declarations: three outer drop shadows (1px, 3px, 6px) to ground the cap in its well, a bright top inset highlight, and a dark bottom inset edge. When pressed (:active or [data-active="true"]), the gradient and shadow stack invert:

.hw-btn:active,
.hw-btn[data-active="true"] {
  background: linear-gradient(180deg,
    oklch(0.88 0.003 80) 0%,
    oklch(0.90 0.003 80) 100%
  );
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.2),
    inset 0 0 1px rgba(0, 0, 0, 0.15);
}

Reversing the gradient from darker at the top (0.88) to lighter at the bottom (0.90) while replacing the outer drop shadows with an inset 0 2px 4px top shadow flips the perceived curvature from convex to concave, making the button sink into the chassis.

To prevent the OKLCH gradients from looking like smooth plastic, every panel mounts a .surface-noise::before pseudo-element rendering an inline SVG feTurbulence filter (baseFrequency="0.9", numOctaves="4") blended with mix-blend-mode: overlay. Using overlay allows the noise grain to warm the underlying OKLCH surface without muddying contrast. Getting that layer right also exposed a classic stacking-context bug: adding position: relative to .surface-noise trapped child Radix popovers and intercepted pointer clicks until we locked the noise pseudo-element to pointer-events: none; z-index: 1 and elevated interactive controls to position: relative; z-index: 2.

2. State relative luminance relationships and change one variable per turn

Early in the build, I would look at a range slider, feel that the thumb cap looked weak, prompt "make the thumb darker," and dislike the result. The cap’s absolute lightness was not the problem—the problem was insufficient contrast against the recessed track, or tick marks at 50% opacity competing for visual weight.

Two prompting rules eliminated that guesswork:

  1. Specify relative relationships rather than raw token values: Telling an agent "make the thumb stone-500" is a blind guess unless you have the palette memorized. Saying "the thumb cap must be darker than the panel face, but lighter than the recessed track groove" states the exact luminance relationship your eye checks, letting the agent compute the appropriate OKLCH lightness stop.
  2. Modify one visual variable per turn: When you spot four flaws on a component and batch all four adjustments into a single prompt, you cannot tell which edit fixed the hierarchy and which one broke the surface warmth. Stepping through "darken the thumb," then "quiet the tick marks," then "tighten the drop shadow" in separate turns converges in three minutes instead of twenty.

3. Overshoot deliberately to find the boundary

Designing the scale-ratio rotary knob showed how fast code generation changes visual exploration. My first prompt specified an elaborate hardware dial: 48 knurled grip ridges around the circumference built with a repeating-conic-gradient, a brushed-metal cap, and an angled specular sheen. In isolation, the CSS rendering looked impressively metallic; placed inside the sidebar beside quiet buttons and matte sliders, it looked like an overwrought 2008 audio plugin.

Rejected rotary knob variant featuring 48 conic-gradient grip ridges, brushed metal texture, and a harsh specular highlight
The rejected 48-ridge rotary knob

I scrapped that version immediately—yet seeing the exaggerated version first made it obvious what to strip away. When an exploration costs a human designer six hours in Figma, you try to be conservative upfront; when it costs a coding agent ninety seconds, deliberately overshooting is the fastest way to locate the line.

The shipped rotary knob derives its depth from quiet layered shadows and houses a rolling mechanical odometer in the center. Each digit renders as a vertical strip of 0–9 inside an overflow: hidden window, driven by translateY(${-digit * DIGIT_H}px), while the decimal point remains in a fixed <span> because physical odometers do not roll their decimal points.

Where verbal prompting hits a wall: motion and spring physics

Static light and shadow translate cleanly into words; motion and easing have to be tuned by feel in the browser. Asking for odometer digits that “decelerate like they have physical mass” yielded cubic-bezier(0.23, 1, 0.32, 1), which we refined by dragging the dial repeatedly at 60fps.

For the dual analog VU meters at the top of the rack—which display live WCAG foreground/background contrast ratios on a 0 to 8 dial—standard CSS transitions looked mechanical and lifeless. We replaced CSS easing with a requestAnimationFrame spring physics loop:

force     = stiffness * (target - current)
dampForce = -damping * velocity

When you click Swap to invert the foreground and background swatches, the loop injects a -600 negative velocity impulse that slams both needles back toward the zero pin before the spring pulls them up to the new contrast reading—mimicking the physical bounce of an analog coil meter. Each needle is rendered as two overlapping SVG <line> elements at identical coordinates: a blurred 3px amber glow layer beneath a sharp 1.2px core line.

4. Guarding against session drift and dark-mode inversion

Two operational traps came up repeatedly across the eight days:

Hardware button states rendered side-by-side in light mode and dark mode
Tactile button states in light and dark modes

And remember that a coding agent will never push back on bad taste: if you ask for a chrome lens flare across the VU meter glass, it will write the SVG filter immediately. Restraint has to come from your side of the keyboard.

Outcome

Two decades of hand-writing CSS mattered more in this workflow, not less. Knowing how stacking contexts, mix-blend-mode, and multi-layer box-shadow declarations composite in the browser let me diagnose why a surface looked flat and ask for a specific fifth pass where someone without CSS fluency would have stopped at the first.

When I shared TypeStax on Hacker News, a typographer posted a detailed critique that caught a discrepancy none of my visual passes had noticed: our uppercase section eyebrows had letter-spacing: 0.2em hardcoded in CSS while the sidebar inspector reported 0.000em. Fixing that bug led to a deeper engineering upgrade—measuring glyph outlines directly on an HTML5 <canvas> to compensate for web fonts with broken OS/2 metric tables, adding curated font pairings, and building live page-layout previews.

The rotary knob is still the first control visitors drag when they open typestax.com—built from plain-English descriptions of light and shadow, without a single reference image.

All notes