RORK LABJP
CLOUD — Rork Max compiles native Swift on a fleet of cloud Macs, so you never download Xcode or need to own a MacPLATFORM — Rork Max targets iPhone, iPad, Apple Watch, and Vision Pro, and reaches games, widgets, and Live ActivitiesSHIP — Build in the browser, preview through a streaming simulator, install on device via QR code, and submit to the App Store without leaving RorkSPLIT — Regular Rork generates cross-platform apps with React Native and Expo. Reach for it to ship broadly and fast, and for Max when you need Apple-specific depthCREDIT — The free tier works out to roughly five prompts a week. It helps to budget the cost of trying something separately from the cost of finishing itPRICE — Rork Max sits on the $200/month Max plan, while regular Rork starts free with paid plans from $25/monthCLOUD — Rork Max compiles native Swift on a fleet of cloud Macs, so you never download Xcode or need to own a MacPLATFORM — Rork Max targets iPhone, iPad, Apple Watch, and Vision Pro, and reaches games, widgets, and Live ActivitiesSHIP — Build in the browser, preview through a streaming simulator, install on device via QR code, and submit to the App Store without leaving RorkSPLIT — Regular Rork generates cross-platform apps with React Native and Expo. Reach for it to ship broadly and fast, and for Max when you need Apple-specific depthCREDIT — The free tier works out to roughly five prompts a week. It helps to budget the cost of trying something separately from the cost of finishing itPRICE — Rork Max sits on the $200/month Max plan, while regular Rork starts free with paid plans from $25/month
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.

Rork525Design Tokens2Expo156Design 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-08-02
When Two-Character Queries Silently Return Nothing: Measuring Japanese Search Indexes in an Expo App
SQLite FTS5's trigram tokenizer returns zero rows for Japanese queries shorter than three characters, without raising anything. I benchmarked linear scan, a bigram inverted index, and FTS5 over a 20,000-item catalog to find the real threshold.
Dev Tools2026-07-30
What Renovate may bump in an Expo app, and what it must never touch
Turning on automated dependency updates in a Rork-generated app also hands Renovate the 123 packages Expo SDK 57 pins. Measured on 2026-07-30, six of them sit a full major version behind npm latest. Here is how to generate the ignore list from the SDK instead of maintaining it by hand.
📚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 →