React

Available Transforms

List of transformations available through codemod.

replace-custom-seed-design-typography

npx @seed-design/codemod@latest replace-custom-seed-design-typography <target_path>

replace-tailwind-typography

npx @seed-design/codemod@latest replace-tailwind-typography <target_path>

replace-custom-imported-typography-variable

Converts imported typography variables when migrating from Sprout to Crispy.

Features

  • Finds typography-related import statements and converts variable names.
  • Finds and updates all locations where variables are used (template literals, object properties, etc.).
  • Converts Sprout typography variables to Crispy based on mapping information from typography.mjs.
  • Removes duplicate imports converted to the same Crispy token (for example, if both subtitle1Regular and bodyM1Regular convert to t5Regular, t5Regular is imported only once).
  • Preserves variable names imported with aliases (for example, converts bodyM1Regular as customTypo to t5Regular as customTypo).
npx @seed-design/codemod@latest replace-custom-imported-typography-variable <target_path>

replace-custom-seed-design-vars

npx @seed-design/codemod@latest replace-custom-seed-design-vars <target_path>

replace-stitches-styled-typography

npx @seed-design/codemod@latest replace-stitches-styled-typography <target_path>

replace-stitches-theme-color

npx @seed-design/codemod@latest replace-stitches-theme-color <target_path>

replace-css-seed-design-color-variable

npx @seed-design/codemod@latest replace-css-seed-design-color-variable <target_path>

replace-react-icon

npx @seed-design/codemod@latest replace-react-icon <target_path>

replace-seed-design-token-vars

npx @seed-design/codemod@latest replace-seed-design-token-vars <target_path>

replace-semantic-stroke-color

A transform that migrates semantic stroke color tokens for v0.2.0.

Purpose

Automatically migrates the semantic stroke color tokens updated in @seed-design/css v0.2.0. Converts stroke tokens from the previous version to match the new naming convention.

Conversion mapping

Priority conversion (pass 1)

⚠️ Important: The following conversion is always processed before the others.

Old tokenNew tokenNote
vars.$color.stroke.neutralMutedvars.$color.stroke.neutralSubtleMust be migrated first

General conversion (pass 2)

Old tokenNew token
vars.$color.stroke.onImagevars.$color.stroke.neutralSubtle
vars.$color.stroke.neutralvars.$color.stroke.neutralMuted
vars.$color.stroke.fieldFocusedvars.$color.stroke.neutralContrast
vars.$color.stroke.controlvars.$color.stroke.neutralWeak
vars.$color.stroke.fieldvars.$color.stroke.neutralWeak
vars.$color.stroke.brandvars.$color.stroke.brandWeak
vars.$color.stroke.positivevars.$color.stroke.positiveWeak
vars.$color.stroke.informativevars.$color.stroke.informativeWeak
vars.$color.stroke.warningvars.$color.stroke.warningWeak
vars.$color.stroke.criticalvars.$color.stroke.criticalWeak

Supported file types

  • TypeScript (.ts)
  • TypeScript JSX (.tsx)

Conversion examples

Basic usage

// Before
import { vars } from "@seed-design/css/vars";
const borderColor = vars.$color.stroke.neutralMuted;
const outlineColor = vars.$color.stroke.neutral;

// After
import { vars } from "@seed-design/css/vars";
const borderColor = vars.$color.stroke.neutralSubtle;
const outlineColor = vars.$color.stroke.neutralMuted;

Usage in a React component

// Before
const Component = () => (
  <div style={{ 
    borderColor: vars.$color.stroke.control,
    outlineColor: vars.$color.stroke.brand 
  }} />
);

// After
const Component = () => (
  <div style={{ 
    borderColor: vars.$color.stroke.neutralWeak,
    outlineColor: vars.$color.stroke.brandWeak 
  }} />
);

Why the priority order matters

This transform operates in a 2-pass approach:

  1. Pass 1: Processes neutralMuted → neutralSubtle first
  2. Pass 2: Processes the remaining conversions, such as neutral → neutralMuted

This order matters because it prevents chained conversions. If the order were reversed, neutral could be converted to neutralMuted before neutralMuted is converted to neutralSubtle, producing an unexpected result.

Tokens that are not converted

The following tokens are already in Crispy format, so they are not converted:

  • vars.$color.stroke.brandWeak
  • vars.$color.stroke.brandSolid
  • vars.$color.stroke.neutralSubtle
  • vars.$color.stroke.neutralContrast
  • vars.$color.stroke.neutralWeak
  • Other tokens with a -weak or -solid suffix

Logging

Running the transform generates the following logs:

  • .report/replace-semantic-stroke-color-success.log: successful conversions
  • .report/replace-semantic-stroke-color-issues.log: warnings and failures
  • .report/replace-semantic-stroke-color-debug.log: debug information
npx @seed-design/codemod@latest replace-semantic-stroke-color <target_path>

replace-custom-seed-design-text-component

npx @seed-design/codemod@latest replace-custom-seed-design-text-component <target_path>

replace-seed-design-token-typography-classname

npx @seed-design/codemod@latest replace-seed-design-token-typography-classname <target_path>

replace-stitches-styled-color

Converts colors in components styled with Stitches to Crispy format.

What it converts

  • Converts Sprout color tokens used in Stitches styled() functions to Crispy color tokens.
  • Supports all color-related style properties (color, backgroundColor, borderColor, etc.).
  • Also converts color changes applied to variants.

Target files

  • Parts of .tsx, .jsx, .ts, .js files that use Stitches styling

Notes

  • Only the color values are changed, keeping the existing code's structure and format as much as possible.
  • Custom color values or CSS variables are not converted.
npx @seed-design/codemod@latest replace-stitches-styled-color <target_path>

replace-custom-text-component-color-prop

npx @seed-design/codemod@latest replace-custom-text-component-color-prop <target_path>

replace-alpha-color

A transform that updates Crispy alpha color tokens to their new names. This transform changes the following alpha color tokens to their new values:

  • staticBlackAlpha50 → staticBlackAlpha200
  • staticBlackAlpha200 → staticBlackAlpha500
  • staticBlackAlpha500 → staticBlackAlpha700
  • staticWhiteAlpha200 → staticWhiteAlpha300

Notes

  • This transform automatically processes both JavaScript/TypeScript files and CSS files.
  • Run only once: Running it multiple times on the same file can cause chained conversions
  • Crispy only: Use this only on projects already using Crispy
  • Backup recommended: It's recommended to back up your code before converting
  • Order matters: Converts from the larger numbers to the smaller ones to prevent chained conversions
npx @seed-design/codemod@latest replace-alpha-color <target_path>

replace-custom-seed-design-color

A transform that converts custom color tokens to Crispy format

npx @seed-design/codemod@latest replace-custom-seed-design-color <target_path>

replace-custom-color-to-seed-design-vars-color

npx @seed-design/codemod@latest replace-custom-color-to-seed-design-vars-color <target_path>

replace-css-seed-design-typography-variable

npx @seed-design/codemod@latest replace-css-seed-design-typography-variable <target_path>

replace-tailwind-color

Converts Tailwind CSS color classes to Crispy format.

What it converts

  • Converts Sprout's color class naming to Crispy format.
  • Converts Tailwind color classes with prefixes such as text-, bg-, border-, etc.
  • Applies a conversion mapping based on the color shade.

Conversion examples

  • text-carrot-500 → text-static-orange-base
  • bg-salmon-100 → bg-static-red-light
  • border-navy-900 → border-static-blue-dark

Target files

  • Parts of .tsx, .jsx, .ts, .js, .html, .css files that use Tailwind classes

Notes

  • className strings, template literals, and array forms are all supported.
  • Tailwind dynamic class combinations (clsx, cx, classnames, etc.) are also converted.
npx @seed-design/codemod@latest replace-tailwind-color <target_path>

Table of contents