RORK LABJP
TOOLING — Rork's developer repos keep moving: rork-xcode was updated on July 16, rork-device on July 15, and rork-plist on July 13OPUS46 — Claude Opus 4.6 is live in Rork, and Rork Max is built to assemble apps on top of Claude CodeSIM — A cloud iOS simulator runs in the browser, with one click to install on a device and two clicks to publish to the App StoreMAX — Rork Max emits pure Swift rather than React Native, reaching iPhone, iPad, Apple Watch, Apple TV, Vision Pro, and even iMessageNATIVE — That opens up HealthKit, ARKit and LiDAR, NFC, Dynamic Island, Live Activities, 3D through Metal, and on-device inference with Core MLSEED — Rork raised a $15M seed led by Left Lane Capital, with Peak XV and a16z Speedrun joining the roundTOOLING — Rork's developer repos keep moving: rork-xcode was updated on July 16, rork-device on July 15, and rork-plist on July 13OPUS46 — Claude Opus 4.6 is live in Rork, and Rork Max is built to assemble apps on top of Claude CodeSIM — A cloud iOS simulator runs in the browser, with one click to install on a device and two clicks to publish to the App StoreMAX — Rork Max emits pure Swift rather than React Native, reaching iPhone, iPad, Apple Watch, Apple TV, Vision Pro, and even iMessageNATIVE — That opens up HealthKit, ARKit and LiDAR, NFC, Dynamic Island, Live Activities, 3D through Metal, and on-device inference with Core MLSEED — Rork raised a $15M seed led by Left Lane Capital, with Peak XV and a16z Speedrun joining the round
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.

Rork515Design Tokens2Expo149Design 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-07-17
Shipping Notifications Without Asking First — Provisional Authorization in Rork Apps, and the Expo Snippet That Quietly Undoes It
iOS lets you start delivering notifications with no permission dialog at all, via provisional authorization. The catch: expo-notifications reports granted as false for provisional devices, so the registration snippet in Expo's own docs re-requests permission and fires the very dialog you were avoiding. Here's why granted lies, a hook that models authorization as five states, how to write notifications for quiet delivery, when to ask for the upgrade, and how to keep provisional out of your CTR.
Dev Tools2026-07-17
Killing the Export Compliance Prompt in Rork Builds for Good
Every Rork and Rork Max build lands in App Store Connect with a Missing Compliance warning. Here is how to decide whether you qualify for the exemption, and how to set it once in app.json or Info.plist so the question never returns.
📚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 →