◉RORK LABJP
●GPT-6.1 SOL — Added to Rork's model menu (09-29) with Low, Medium and High effort; included on Pro and Max●SONNET 5.5 — Claude Sonnet 5.5 is selectable: strong at UI design and faster than Sonnet 5 (09-28)●SONNET 4.5 — Retires on the Claude API on 11/30, 27 days left. If your app calls it, check the migration target●SDK 58 — Moves to React Native 0.88. R8 is now on by default in Android release builds, and iOS prebuild generates a SceneDelegate●OBSERVE — EAS Observe now records native crashes too (SDK 57.0.21 or later, 10/07)●NEW — My App Open Ad Only Showed When the App…●GPT-6.1 SOL — Added to Rork's model menu (09-29) with Low, Medium and High effort; included on Pro and Max●SONNET 5.5 — Claude Sonnet 5.5 is selectable: strong at UI design and faster than Sonnet 5 (09-28)●SONNET 4.5 — Retires on the Claude API on 11/30, 27 days left. If your app calls it, check the migration target●SDK 58 — Moves to React Native 0.88. R8 is now on by default in Android release builds, and iOS prebuild generates a SceneDelegate●OBSERVE — EAS Observe now records native crashes too (SDK 57.0.21 or later, 10/07)●NEW — My App Open Ad Only Showed When the App…
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.

Rork611Design Tokens3Expo234Design System3Maintainability

✦ 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-10-30
It runs in development but the iOS Release build dies on launch — checking whether a missing scheme is the cause
In an expo-router app, an app.json with no scheme can crash only the iOS Release build at launch. Why Debug and Android survive, the two ways to fix it, how to think about leaving the scheme out on purpose, and a pre-submission check.
⬡ Dev Tools2026-10-15
When EXPO_PUBLIC_ Values Read Fine in Dev but Come Back undefined in Production: Telling the Spellings Apart
The API URL reads fine while developing and turns undefined once the app is built. The cause was how process.env was written. I lined up babel-preset-expo's output for dev and production and tabulated which spellings get replaced and which are left behind.
⬡ Dev Tools2026-10-13
Before You Ship: Go Looking for Your Own Keys Inside the Exported Expo Bundle
A key can be missing from your source and still be sitting inside the finished app. I ran expo export on Expo SDK 57, searched the bundle with grep and a short Node script, and recorded which secrets show up and which don't.