RORK LABJP
MAX — Rork Max generates native Swift apps for iPhone, iPad, Apple Watch, Apple TV, Vision Pro, and iMessagePUBLISH — Rork Max ships 2-click App Store publishing and runs $200/monthRN — The standard Rork builds native iOS/Android apps with React Native (Expo) — the quicker path to a working appPRICE — Rork is free to start, with paid plans from $25/monthFUND — Rork raised $2.8M from a16z; the platform now sees 743k+ monthly visits with 85% growthFLOW — Describe your app in plain English and Rork generates deployable code that can use the camera, notifications, and moreMAX — Rork Max generates native Swift apps for iPhone, iPad, Apple Watch, Apple TV, Vision Pro, and iMessagePUBLISH — Rork Max ships 2-click App Store publishing and runs $200/monthRN — The standard Rork builds native iOS/Android apps with React Native (Expo) — the quicker path to a working appPRICE — Rork is free to start, with paid plans from $25/monthFUND — Rork raised $2.8M from a16z; the platform now sees 743k+ monthly visits with 85% growthFLOW — Describe your app in plain English and Rork generates deployable code that can use the camera, notifications, and more
Articles/Dev Tools
Dev Tools/2026-06-15Intermediate

Stopping the Slow Drift of Colors and Spacing on Every Regeneration with a Single Source of Design Tokens

Every time Rork regenerates a screen, button colors and spacing shift a little. Here is a design that freezes your tokens in one place and steers generated output to always reference them.

Rork422Design TokensExpo86Design System3Maintainability2

Premium Article

One day I lined up the screenshots of a shipped app and felt something was off. Inside the same app, only the settings-screen button had a noticeably larger corner radius. Tracing it back, that one screen had been rebuilt in Rork the week before. With each generation the radius had crept from 12 to 16, and the primary blue had drifted ever so slightly brighter — quietly.

One screen, you fix by hand. But when you run several apps as an indie developer, that "creep" accumulates until the outline of your brand goes blurry. Generative AI excels at filling in what you did not specify, so it plausibly reconstructs the "unspoken" parts — colors and spacing — every time. That reconstruction was the true source of the drift on each regeneration.

Why generated visuals shift every time

The styles in the Expo apps Rork generates are usually written as raw numbers right inside components: borderRadius: 12, padding: 16, color: "#2563EB". These are scattered across every screen, and on regeneration the AI re-estimates them from context as "roughly this much." Any value not explicit in the instruction gets reconstructed at a slightly different number each time.

So the root of the drift is that authority over appearance is dispersed across countless components. As long as that authority is scattered, regeneration drifts. There is one direction for the fix: gather the appearance decisions into one place.

Consolidate tokens into a single source

The first step is to freeze your "design vocabulary" — color, spacing, radius, typography — into one file. This is the one file you do not let the AI regenerate; a human owns it.

// tokens.ts — the only place that decides this app's appearance
// Not regenerated by AI. Every change is a hand edit here.
export const tokens = {
  color: {
    brand: "#2563EB",
    brandPressed: "#1D4ED8",
    bg: "#FFFFFF",
    text: "#0F172A",
    textMuted: "#64748B",
    danger: "#DC2626",
  },
  radius: { sm: 8, md: 12, lg: 16, pill: 999 },
  space: { xs: 4, sm: 8, md: 12, lg: 16, xl: 24, xxl: 32 },
  font: { body: 16, title: 22, caption: 13 },
} as const;
 
export type Tokens = typeof tokens;

Components no longer hold raw numbers. They always go through tokens.

// PrimaryButton.tsx — never writes a raw number; everything references tokens
import { Pressable, Text, StyleSheet } from "react-native";
import { tokens } from "../tokens";
 
export function PrimaryButton({ label, onPress }: {
  label: string; onPress: () => void;
}) {
  return (
    <Pressable onPress={onPress} style={styles.btn}>
      <Text style={styles.label}>{label}</Text>
    </Pressable>
  );
}
 
const styles = StyleSheet.create({
  btn: {
    backgroundColor: tokens.color.brand,
    borderRadius: tokens.radius.md,
    paddingVertical: tokens.space.md,
    paddingHorizontal: tokens.space.lg,
    alignItems: "center",
  },
  label: { color: "#FFFFFF", fontSize: tokens.font.body, fontWeight: "600" },
});

Now the decision "the blue button's radius is 12" exists in exactly one spot in the world. There is no room left for regeneration to re-estimate borderRadius.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
Why colors, spacing, and corner radii drift on regeneration, and a single-source token design that stops it
A prompt convention that makes the AI reference tokens every time, plus a CI script that flags deviations
An operating rule that keeps brand consistency across six apps without slowing down screen regeneration
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Dev Tools2026-03-17
Rork × Google Stitch — From UI Design to React Native App with AI
Learn how to take Google Stitch-generated UI designs into Rork Max and ship production-quality React Native apps faster than ever before.
Dev Tools2026-06-19
Adding a Minimal Test Safety Net to Rork-Generated Screens
You add one new screen to a Rork app, and a completely unrelated paywall check quietly breaks. This is how to bolt a minimal automated test safety net onto generated code with Jest and React Native Testing Library — protecting only the three places that hurt when they break.
Dev Tools2026-06-18
Retrofitting Offline-First Into a Rork App: Persistent Cache and a Write Queue
Reviews kept saying the app was blank on the subway. Polishing error screens was not enough, so I retrofitted TanStack Query persistence and an offline write queue into a Rork-generated Expo app. Optimistic updates, reconnect flushing, and keeping the layer safe from regeneration are all covered with code.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →