Migration Guide

Token Replacements

Our token architecture separates styling into a strict foundations scale and a role-based semantic scale. When refactoring, replace raw colors and border-radius utilities with design system custom tokens:

Legacy UtilityShavin Token UtilityRole / Meaning
bg-white / bg-zinc-100bg-canvasRoot application canvas background
bg-zinc-50bg-surfaceBase card and content element backgrounds
text-zinc-900text-fgPrimary text and layout headings
text-zinc-500text-fg-mutedMuted subheadings or description texts
border-zinc-200border-hairlineThin panel borders and divides
rounded-lgrounded-[var(--radius-lg)]Button, switch, and textfield borders

Refactoring Example

Consider a legacy product container block styled with static Tailwind classes:

Before (Legacy)

<div className="bg-white border border-gray-200 p-4 rounded-lg">
  <h3 className="text-gray-900 font-bold">Billing</h3> {/* ds-lint-disable-line no-unknown-class — documenting legacy styles */}
  <p className="text-gray-500 text-sm">Manage payment info</p> {/* ds-lint-disable-line no-unknown-class — documenting legacy styles */}
</div>

After (Shavin)

import { Card, Flex, Text } from "@shavin/ui";

<Card padding="sm">
  <Flex direction="col" gap="1">
    <Text weight="semibold" className="text-fg">Billing</Text>
    <Text size="xs" color="muted">Manage payment info</Text>
  </Flex>
</Card>
Discipline: Enforced by our local linter checks, any use of hardcoded Tailwind colors (like bg-gray-100) will trigger typecheck failures on build.
Configure Theme
Theme
Accent Color
Custom
Gray Family
Appearance
Radius
Scaling
Panel Style
Heading Font
Body Font