# Available Transforms URL: /react/developer-tools/codemods/available-transforms Source: https://github.com/daangn/seed-design/blob/dev/docs/content/react/developer-tools/codemods/available-transforms.mdx List of transformations available through codemod. {/* Auto-generated from `scripts/generate-codemod-docs.ts` */} ## replace-custom-seed-design-typography - npm: npx @seed-design/codemod@latest replace-custom-seed-design-typography \ - pnpm: pnpm dlx @seed-design/codemod@latest replace-custom-seed-design-typography \ - yarn: yarn dlx @seed-design/codemod@latest replace-custom-seed-design-typography \ - bun: bun x @seed-design/codemod@latest replace-custom-seed-design-typography \ ```ts title="basic.input.ts" // @ts-nocheck import { style } from "@vanilla-extract/css"; import { vars } from "@seed-design/css"; import { f, reset } from "@/shared/styles"; import { typography, text } from '@/src/styles/tokens'; export const title = style([ typography.h4, { textAlign: "center", color: vars.$scale.color.gray900, margin: 0, }, ]); export const subtitle = style([ f.typography.title2Bold, { marginBottom: "0.375rem", color: vars.$scale.color.gray900, }, ]); export const smallText = style([ typo.caption2Regular, { color: vars.$scale.color.gray700, }, ]); export const largeTitle = style([ typo.bodyL1Regular, { color: vars.$scale.color.gray900, }, ]); export const button = style([ typography['$semantic.label2Regular'], { width: '100%', paddingTop: rem(14), paddingRight: rem(16), paddingBottom: rem(14), paddingLeft: rem(16), }, ]); export const day = style([ { display: 'flex', flex: 1, alignItems: 'center', justifyContent: 'center', height: rem(30), }, typography['$semantic.caption1Regular'], ]); // Additional test cases for various mappings export const titleBold = style([ typography.title3Bold, { fontWeight: 'bold', }, ]); export const subtitleRegular = style([ f.typography.subtitle2Regular, { color: vars.$scale.color.gray800, }, ]); export const bodyText = style([ typo.bodyM1Regular, { lineHeight: 1.5, }, ]); export const labelText = style([ typography['$semantic.label1Bold'], { textTransform: 'uppercase', }, ]); export const captionBold = style([ typography['$semantic.caption2Bold'], { fontSize: '12px', }, ]); // Test deprecated tokens with alternative export const deprecatedBody = style([ typo.bodyL2Regular, { margin: '8px 0', }, ]); export const deprecatedLabel = style([ typography['$semantic.label6Regular'], { opacity: 0.8, }, ]); // Test multiple token choices (should use first one) export const headerText = style([ typography.h4, { textAlign: 'center', }, ]); export const text = style([ text['$semantic.bodyL2Bold'], ]); ``` ```ts title="basic.output.ts" // @ts-nocheck import { style } from "@vanilla-extract/css"; import { vars } from "@seed-design/css"; import { f, reset } from "@/shared/styles"; import { typography, text } from '@/src/styles/tokens'; export const title = style([ typography.t10Bold, { textAlign: "center", color: vars.$scale.color.gray900, margin: 0, }, ]); export const subtitle = style([ f.typography.t7Bold, { marginBottom: "0.375rem", color: vars.$scale.color.gray900, }, ]); export const smallText = style([ typo.t2Regular, { color: vars.$scale.color.gray700, }, ]); export const largeTitle = style([ typo.articleBody, { color: vars.$scale.color.gray900, }, ]); export const button = style([ typography.t5Regular, { width: '100%', paddingTop: rem(14), paddingRight: rem(16), paddingBottom: rem(14), paddingLeft: rem(16), }, ]); export const day = style([ { display: 'flex', flex: 1, alignItems: 'center', justifyContent: 'center', height: rem(30), }, typography.t3Regular, ]); // Additional test cases for various mappings export const titleBold = style([ typography.t6Bold, { fontWeight: 'bold', }, ]); export const subtitleRegular = style([ f.typography.t4Regular, { color: vars.$scale.color.gray800, }, ]); export const bodyText = style([ typo.t5Regular, { lineHeight: 1.5, }, ]); export const labelText = style([ typography.t6Bold, { textTransform: 'uppercase', }, ]); export const captionBold = style([ typography.t2Bold, { fontSize: '12px', }, ]); // Test deprecated tokens with alternative export const deprecatedBody = style([ typo.t4Regular, { margin: '8px 0', }, ]); export const deprecatedLabel = style([ typography.t1Regular, { opacity: 0.8, }, ]); // Test multiple token choices (should use first one) export const headerText = style([ typography.t10Bold, { textAlign: 'center', }, ]); export const text = style([ text.t4Bold, ]); ``` ## replace-tailwind-typography - npm: npx @seed-design/codemod@latest replace-tailwind-typography \ - pnpm: pnpm dlx @seed-design/codemod@latest replace-tailwind-typography \ - yarn: yarn dlx @seed-design/codemod@latest replace-tailwind-typography \ - bun: bun x @seed-design/codemod@latest replace-tailwind-typography \ ```tsx title="basic.input.tsx" // @ts-nocheck export function BasicExample() { return (
Primary Background

{formState.content}

Hover Primary Low Background
Focus Primary Low Background
Focus Primary Low Background

{description}

Text with prefix
Another text with prefix

Title with prefix

); } ``` ```tsx title="basic.output.tsx" // @ts-nocheck export function BasicExample() { return (
Primary Background

{formState.content}

Hover Primary Low Background
Focus Primary Low Background
Focus Primary Low Background

{description}

Text with prefix
Another text with prefix

Title with prefix

); } ``` ## 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`). * npm: npx @seed-design/codemod@latest replace-custom-imported-typography-variable \ * pnpm: pnpm dlx @seed-design/codemod@latest replace-custom-imported-typography-variable \ * yarn: yarn dlx @seed-design/codemod@latest replace-custom-imported-typography-variable \ * bun: bun x @seed-design/codemod@latest replace-custom-imported-typography-variable \ ```ts title="basic.input.ts" // @ts-nocheck import { subtitle1Regular, subtitle2Regular, h4, title1Bold, title2Bold, bodyL1Regular, bodyL2Regular, caption1Regular, caption2Regular, label5Regular, } from '@src/constants/typography' import { bodyM1Regular as customTypo } from '@karrot/typography' const S_StoreRequestTitle = styled.h1` ${subtitle1Regular}; margin: 0 0 0.25rem; color: ${vars.$scale.color.gray900}; text-align: center; ` const S_StoreRequestText = styled.p` ${subtitle2Regular}; margin: 0; color: ${vars.$scale.color.gray600}; text-align: center; ` // Additional test cases // screenTitle mapping test const S_ScreenHeader = styled.h1` ${h4}; margin-bottom: 1rem; ` // General mapping test const S_Title = styled.h2` ${title1Bold}; color: ${vars.$scale.color.gray900}; ` // Component with multiple test cases const Card = styled.div` // title2Bold mapping test h3 { ${title2Bold}; margin-bottom: 8px; } // bodyL1Regular mapping test p.description { ${bodyL1Regular}; color: ${vars.$scale.color.gray800}; } // Fallback token mapping case p.content { ${bodyL2Regular}; margin: 0; } // Caption style p.caption { ${caption1Regular}; color: ${vars.$scale.color.gray600}; } // Small text small { ${caption2Regular}; color: ${vars.$scale.color.gray500}; } // Label style label { ${label5Regular}; margin-right: 4px; } ` // Handling typography imported from another module (alias must be maintained) const S_CustomContent = styled.div` ${customTypo}; color: ${vars.$scale.color.gray700}; ` // Using as variable const titleStyle = title1Bold; const textStyle = subtitle1Regular; ``` ```ts title="basic.output.ts" // @ts-nocheck import { t5Regular, t4Regular, t10Bold, t9Bold, t7Bold, articleBody, t3Regular, t2Regular, t1Regular, } from '@src/constants/typography'; import { t5Regular as customTypo } from '@karrot/typography' const S_StoreRequestTitle = styled.h1` ${t5Regular}; margin: 0 0 0.25rem; color: ${vars.$scale.color.gray900}; text-align: center; ` const S_StoreRequestText = styled.p` ${t4Regular}; margin: 0; color: ${vars.$scale.color.gray600}; text-align: center; ` // Additional test cases // screenTitle mapping test const S_ScreenHeader = styled.h1` ${t10Bold}; margin-bottom: 1rem; ` // General mapping test const S_Title = styled.h2` ${t9Bold}; color: ${vars.$scale.color.gray900}; ` // Component with multiple test cases const Card = styled.div` // title2Bold mapping test h3 { ${t7Bold}; margin-bottom: 8px; } // bodyL1Regular mapping test p.description { ${articleBody}; color: ${vars.$scale.color.gray800}; } // Fallback token mapping case p.content { ${t4Regular}; margin: 0; } // Caption style p.caption { ${t3Regular}; color: ${vars.$scale.color.gray600}; } // Small text small { ${t2Regular}; color: ${vars.$scale.color.gray500}; } // Label style label { ${t1Regular}; margin-right: 4px; } ` // Handling typography imported from another module (alias must be maintained) const S_CustomContent = styled.div` ${customTypo}; color: ${vars.$scale.color.gray700}; ` // Using as variable const titleStyle = t9Bold; const textStyle = t5Regular; ``` ## replace-custom-seed-design-vars - npm: npx @seed-design/codemod@latest replace-custom-seed-design-vars \ - pnpm: pnpm dlx @seed-design/codemod@latest replace-custom-seed-design-vars \ - yarn: yarn dlx @seed-design/codemod@latest replace-custom-seed-design-vars \ - bun: bun x @seed-design/codemod@latest replace-custom-seed-design-vars \ ```ts title="basic.input.ts" // @ts-nocheck import { vars } from '@/shared/style/vars'; export const date = style({ ...vars.typography.caption1Regular, color: vars.color.gray600, }); export const color1 = style({ color: vars.color.yellow500, }); export const color2 = style({ color: vars.color.blue500, }); export const color3 = style({ color: vars.color.red500, }); export const title = style({ ...vars.typography.bodyM1Bold, color: vars.color.primary, }); export const subtitle = style({ ...vars.typography.bodyM2Regular, color: vars.color.secondary, }); // Background color case export const cardBackground = style({ backgroundColor: vars.color.paperSheet, padding: '16px', }); // Border case export const divider = style({ borderTop: `1px solid ${vars.color.divider1}`, marginTop: '8px', marginBottom: '8px', }); // Status color case export const successMessage = style({ ...vars.typography.bodyM1Bold, color: vars.color.success, backgroundColor: vars.color.successLow, padding: '12px', borderRadius: '4px', }); export const warningMessage = style({ ...vars.typography.bodyM1Bold, color: vars.color.warning, backgroundColor: vars.color.warningLow, padding: '12px', borderRadius: '4px', }); export const errorMessage = style({ ...vars.typography.bodyM1Bold, color: vars.color.danger, backgroundColor: vars.color.dangerLow, padding: '12px', borderRadius: '4px', }); // Various typography cases export const heading = style({ ...vars.typography.h4, color: vars.color.inkText, }); export const body = style({ ...vars.typography.bodyL1Regular, color: vars.color.inkTextLow, }); export const label = style({ ...vars.typography.label3Bold, color: vars.color.grayActive, }); // Alpha color case export const overlay = style({ backgroundColor: vars.color.overlayDim, position: 'absolute', top: 0, left: 0, right: 0, bottom: 0, }); // Compound case and interaction states export const button = style({ ...vars.typography.label2Bold, backgroundColor: vars.color.primary, color: vars.color.onPrimary, borderRadius: '4px', padding: '8px 16px', border: 'none', cursor: 'pointer', ':hover': { backgroundColor: vars.color.primaryHover, }, ':active': { backgroundColor: vars.color.primaryPressed, }, }); export const secondaryButton = style({ ...vars.typography.label2Bold, backgroundColor: vars.color.secondaryLow, color: vars.color.secondary, borderRadius: '4px', padding: '8px 16px', border: 'none', cursor: 'pointer', ':hover': { backgroundColor: vars.color.grayHover, }, ':active': { backgroundColor: vars.color.grayPressed, }, }); // Nested path case export const floatingPanel = style({ backgroundColor: vars.color.paperFloating, boxShadow: `0 2px 8px ${vars.color.overlayLow}`, padding: '20px', borderRadius: '8px', }); export const dialogPanel = style({ backgroundColor: vars.color.paperDialog, padding: '24px', boxShadow: `0 4px 16px ${vars.color.overlayDim}`, borderRadius: '12px', }); // Static color case export const staticColors = style({ color: vars.color.staticBlack, backgroundColor: vars.color.staticWhite, border: `1px solid ${vars.color.staticBlackAlpha200}`, }); // Static color case (explicit static prefix test) export const staticExplicitColors = style({ color: vars.color.staticBlack, backgroundColor: vars.color.staticWhite, boxShadow: `0 2px 4px ${vars.color.staticBlackAlpha500}`, outline: `1px solid ${vars.color.staticBlackAlpha200}`, }); export const specialBackground = style({ background: `linear-gradient(to bottom, ${vars.color.staticWhiteAlpha50}, ${vars.color.staticWhiteAlpha200})`, backdropFilter: 'blur(8px)', }); // Compound style and multiple property case export const multiProperty = style({ ...vars.typography.title2Bold, color: vars.color.accent, borderLeft: `4px solid ${vars.color.accent}`, borderRight: `4px solid ${vars.color.accent}`, boxShadow: `inset 0 0 0 1px ${vars.color.divider2}, 0 2px 4px ${vars.color.overlayLow}`, padding: '16px', backgroundColor: vars.color.paperDefault, }); // Mixin style case export const mixinStyle = { primary: { background: vars.color.primary, color: vars.color.onPrimary, }, secondary: { background: vars.color.secondary, }, accent: { background: vars.color.accent, color: vars.color.onGrayOverlay50, }, }; // Special property and scale color case export const scaleColors = style({ fill: vars.color.carrot500, stroke: vars.color.gray400, stopColor: vars.color.blue400, floodColor: vars.color.red400, lightingColor: vars.color.green400, }); // Special typography case export const specialTypographies = { title: vars.typography.title1Bold, subtitle: vars.typography.subtitle1Regular, label: vars.typography.label5Regular, caption: vars.typography.caption2Bold, }; // Color tokens with various paths export const colorContexts = style({ // General color color: vars.color.primaryLow, // Background color backgroundColor: vars.color.paperBackground, // Border color borderColor: vars.color.divider3, // Hover color ':hover': { backgroundColor: vars.color.primaryLowHover, borderColor: vars.color.primaryLowActive, }, }); // Complex multi-path and nested object export const nestedStyleObject = { button: { default: { backgroundColor: vars.color.paperAccent, color: vars.color.inkText, border: `1px solid ${vars.color.carrot300}`, }, hover: { backgroundColor: vars.color.carrot100, borderColor: vars.color.carrot400, }, active: { backgroundColor: vars.color.carrot200, color: vars.color.inkTextLow, }, }, panel: { header: { ...vars.typography.subtitle2Bold, color: vars.color.blue600, borderBottom: `1px solid ${vars.color.blue200}`, }, body: { ...vars.typography.bodyM2Regular, color: vars.color.inkTextLow, backgroundColor: vars.color.blue50, }, footer: { backgroundColor: vars.color.blue100, borderTop: `1px solid ${vars.color.blue200}`, }, }, }; // Border property mapping test export const borderMapping = style({ // Property that maps to a stroke token borderColor: vars.color.divider2, // Case substituted with an fg token because no stroke token exists borderTopColor: vars.color.primary, borderBottomColor: vars.color.accent, // Substituted with a stroke or fg token boxShadow: `0 0 0 1px ${vars.color.primary}, 0 2px 4px ${vars.color.overlayLow}`, // Compound property border: `1px solid ${vars.color.secondary}`, }); ``` ```ts title="basic.output.ts" // @ts-nocheck import { vars } from "@/shared/style/vars"; export const date = style({ ...vars.typography.t3Regular, color: vars.color.palette.gray700, }); export const color1 = style({ color: vars.color.palette.yellow700, }); export const color2 = style({ color: vars.color.palette.blue600, }); export const color3 = style({ color: vars.color.palette.red700, }); export const title = style({ ...vars.typography.t5Bold, color: vars.color.fg.brand, }); export const subtitle = style({ ...vars.typography.t4Regular, color: vars.color.palette.gray900, }); // Background color case export const cardBackground = style({ backgroundColor: vars.color.bg.layerFloating, padding: "16px", }); // Border case export const divider = style({ borderTop: `1px solid ${vars.color.stroke.neutralSubtle}`, marginTop: "8px", marginBottom: "8px", }); // Status color case export const successMessage = style({ ...vars.typography.t5Bold, color: vars.color.fg.positive, backgroundColor: vars.color.bg.positiveWeak, padding: "12px", borderRadius: "4px", }); export const warningMessage = style({ ...vars.typography.t5Bold, color: vars.color.bg.warningSolid, backgroundColor: vars.color.bg.warningWeak, padding: "12px", borderRadius: "4px", }); export const errorMessage = style({ ...vars.typography.t5Bold, color: vars.color.fg.critical, backgroundColor: vars.color.bg.criticalWeak, padding: "12px", borderRadius: "4px", }); // Various typography cases export const heading = style({ ...vars.typography.t10Bold, color: vars.color.fg.neutral, }); export const body = style({ ...vars.typography.articleBody, color: vars.color.fg.neutralSubtle, }); export const label = style({ ...vars.typography.t4Bold, color: vars.color.fg.neutralMuted, }); // Alpha color case export const overlay = style({ backgroundColor: vars.color.bg.overlay, position: "absolute", top: 0, left: 0, right: 0, bottom: 0, }); // Compound case and interaction states export const button = style({ ...vars.typography.t5Bold, backgroundColor: vars.color.bg.brandSolid, color: vars.color.palette.staticWhite, borderRadius: "4px", padding: "8px 16px", border: "none", cursor: "pointer", ":hover": { backgroundColor: vars.color.bg.brandSolidPressed, }, ":active": { backgroundColor: vars.color.bg.brandSolidPressed, }, }); export const secondaryButton = style({ ...vars.typography.t5Bold, backgroundColor: vars.color.bg.neutralWeak, color: vars.color.palette.gray900, borderRadius: "4px", padding: "8px 16px", border: "none", cursor: "pointer", ":hover": { backgroundColor: vars.color.bg.neutralWeakPressed, }, ":active": { backgroundColor: vars.color.bg.neutralWeakPressed, }, }); // Nested path case export const floatingPanel = style({ backgroundColor: vars.color.bg.layerFloating, boxShadow: `0 2px 8px ${vars.color.bg.overlayMuted}`, padding: "20px", borderRadius: "8px", }); export const dialogPanel = style({ backgroundColor: vars.color.bg.layerFloating, padding: "24px", boxShadow: `0 4px 16px ${vars.color.bg.overlay}`, borderRadius: "12px", }); // Static color case export const staticColors = style({ color: vars.color.palette.staticBlack, backgroundColor: vars.color.palette.staticWhite, border: `1px solid ${vars.color.palette.staticBlackAlpha200}`, }); // Static color case (explicit static prefix test) export const staticExplicitColors = style({ color: vars.color.palette.staticBlack, backgroundColor: vars.color.palette.staticWhite, boxShadow: `0 2px 4px ${vars.color.palette.staticBlackAlpha500}`, outline: `1px solid ${vars.color.palette.staticBlackAlpha200}`, }); export const specialBackground = style({ background: `linear-gradient(to bottom, ${vars.color.palette.staticWhiteAlpha50}, ${vars.color.palette.staticWhiteAlpha200})`, backdropFilter: "blur(8px)", }); // Compound style and multiple property case export const multiProperty = style({ ...vars.typography.t7Bold, color: vars.color.fg.informative, borderLeft: `4px solid ${vars.color.fg.informative}`, borderRight: `4px solid ${vars.color.fg.informative}`, boxShadow: `inset 0 0 0 1px ${vars.color.stroke.neutral}, 0 2px 4px ${vars.color.bg.overlayMuted}`, padding: "16px", backgroundColor: vars.color.bg.layerDefault, }); // Mixin style case export const mixinStyle = { primary: { background: vars.color.bg.brandSolid, color: vars.color.palette.staticWhite, }, secondary: { background: vars.color.palette.gray900, }, accent: { background: vars.color.bg.informativeSolid, color: vars.color.stroke.onImage, }, }; // Special property and scale color case export const scaleColors = style({ fill: vars.color.palette.carrot600, stroke: vars.color.palette.gray500, stopColor: vars.color.palette.blue400, floodColor: vars.color.palette.red600, lightingColor: vars.color.palette.green500, }); // Special typography case export const specialTypographies = { title: vars.typography.t9Bold, subtitle: vars.typography.t5Regular, label: vars.typography.t1Regular, caption: vars.typography.t2Bold, }; // Color tokens with various paths export const colorContexts = style({ // General color color: vars.color.palette.carrot100, // Background color backgroundColor: vars.color.bg.layerBasement, // Border color borderColor: vars.color.palette.gray400, // Hover color ":hover": { backgroundColor: vars.color.palette.carrot200, borderColor: vars.color.palette.carrot100, }, }); // Complex multi-path and nested object export const nestedStyleObject = { button: { default: { backgroundColor: vars.color.palette.carrot100, color: vars.color.fg.neutral, border: `1px solid ${vars.color.palette.carrot400}`, }, hover: { backgroundColor: vars.color.palette.carrot200, borderColor: vars.color.palette.carrot500, }, active: { backgroundColor: vars.color.palette.carrot300, color: vars.color.fg.neutralSubtle, }, }, panel: { header: { ...vars.typography.t4Bold, color: vars.color.palette.blue600, borderBottom: `1px solid ${vars.color.palette.blue300}`, }, body: { ...vars.typography.t4Regular, color: vars.color.fg.neutralSubtle, backgroundColor: vars.color.palette.blue100, }, footer: { backgroundColor: vars.color.palette.blue200, borderTop: `1px solid ${vars.color.palette.blue300}`, }, }, }; // Border property mapping test export const borderMapping = style({ // Property that maps to a stroke token borderColor: vars.color.stroke.neutral, // Case substituted with an fg token because no stroke token exists borderTopColor: vars.color.fg.brand, borderBottomColor: vars.color.fg.informative, // Substituted with a stroke or fg token boxShadow: `0 0 0 1px ${vars.color.bg.brandSolid}, 0 2px 4px ${vars.color.bg.overlayMuted}`, // Compound property border: `1px solid ${vars.color.palette.gray900}`, }); ``` ## replace-stitches-styled-typography - npm: npx @seed-design/codemod@latest replace-stitches-styled-typography \ - pnpm: pnpm dlx @seed-design/codemod@latest replace-stitches-styled-typography \ - yarn: yarn dlx @seed-design/codemod@latest replace-stitches-styled-typography \ - bun: bun x @seed-design/codemod@latest replace-stitches-styled-typography \ ```tsx title="basic.input.tsx" // @ts-nocheck const ContentText = styled('p', { ...userSelectText, overflow: 'hidden', whiteSpace: 'pre-wrap', wordBreak: 'break-word', color: '$gray900', variants: { size: { medium: { $text: 'bodyM1Regular', }, large: { $text: 'bodyL1Regular', }, xlarge: { $text: "h4", }, }, }, }); const ContentText2 = styled('p', { ...userSelectText, overflow: 'hidden', whiteSpace: 'pre-wrap', wordBreak: 'break-word', color: '$gray900', variants: { size: { medium: { $typography: 'bodyM1Regular', }, large: { $typography: 'bodyL1Regular', }, xlarge: { $typography: "h4", }, }, }, }); ``` ```tsx title="basic.output.tsx" // @ts-nocheck const ContentText = styled('p', { ...userSelectText, overflow: 'hidden', whiteSpace: 'pre-wrap', wordBreak: 'break-word', color: '$gray900', variants: { size: { medium: { $text: "t5Regular", }, large: { $text: "articleBody", }, xlarge: { $text: "t10Bold", }, }, }, }); const ContentText2 = styled('p', { ...userSelectText, overflow: 'hidden', whiteSpace: 'pre-wrap', wordBreak: 'break-word', color: '$gray900', variants: { size: { medium: { $typography: "t5Regular", }, large: { $typography: "articleBody", }, xlarge: { $typography: "t10Bold", }, }, }, }); ``` ## replace-stitches-theme-color - npm: npx @seed-design/codemod@latest replace-stitches-theme-color \ - pnpm: pnpm dlx @seed-design/codemod@latest replace-stitches-theme-color \ - yarn: yarn dlx @seed-design/codemod@latest replace-stitches-theme-color \ - bun: bun x @seed-design/codemod@latest replace-stitches-theme-color \ ```tsx title="basic.input.tsx" // @ts-nocheck import { theme } from "@src/stitches/stitches.config"; const semanticColors = { primary: theme.colors["primary-semantic"].computedValue, onPrimary: theme.colors["onPrimary-semantic"].computedValue, primaryLow: theme.colors["primaryLow-semantic"].computedValue, success: theme.colors["success-semantic"].computedValue, warning: theme.colors["warning-semantic"].computedValue, danger: theme.colors["danger-semantic"].computedValue, paperDefault: theme.colors["paperDefault-semantic"].computedValue, paperContents: theme.colors["paperContents-semantic"].computedValue, paperDialog: theme.colors["paperDialog-semantic"].computedValue, inkText: theme.colors["inkText-semantic"].computedValue, inkTextLow: theme.colors["inkTextLow-semantic"].computedValue, divider1: theme.colors["divider1-semantic"].computedValue, divider2: theme.colors["divider2-semantic"].computedValue, overlayDim: theme.colors["overlayDim-semantic"].computedValue, accent: theme.colors["accent-semantic"].computedValue, }; const scaleColors = { gray00: theme.colors.gray00.computedValue, gray100: theme.colors.gray100.computedValue, gray200: theme.colors.gray200.computedValue, gray300: theme.colors.gray300.computedValue, gray400: theme.colors.gray400.computedValue, gray500: theme.colors.gray500.computedValue, gray600: theme.colors.gray600.computedValue, gray700: theme.colors.gray700.computedValue, gray800: theme.colors.gray800.computedValue, gray900: theme.colors.gray900.computedValue, carrot100: theme.colors.carrot100.computedValue, carrot500: theme.colors.carrot500.computedValue, carrot900: theme.colors.carrot900.computedValue, carrotAlpha50: theme.colors.carrotAlpha50.computedValue, carrotAlpha100: theme.colors.carrotAlpha100.computedValue, carrotAlpha200: theme.colors.carrotAlpha200.computedValue, blue300: theme.colors.blue300.computedValue, blue600: theme.colors.blue600.computedValue, red500: theme.colors.red500.computedValue, }; const staticColors = { white: theme.colors["white-static"].computedValue, black: theme.colors["black-static"].computedValue, blackAlpha200: theme.colors["blackAlpha200-static"].computedValue, whiteAlpha200: theme.colors["whiteAlpha200-static"].computedValue, gray900: theme.colors["gray900-static"].computedValue, carrot50: theme.colors["carrot50-static"].computedValue, carrot800: theme.colors["carrot800-static"].computedValue, blue50: theme.colors["blue50-static"].computedValue, blue800: theme.colors["blue800-static"].computedValue, red50: theme.colors["red50-static"].computedValue, red800: theme.colors["red800-static"].computedValue, }; const Component = () => { return (
Notice Important
); }; const Dialog = ({ isOpen, onClose }) => { const styles = { overlay: { backgroundColor: theme.colors["overlayDim-semantic"].computedValue, }, container: { backgroundColor: theme.colors["paperDialog-semantic"].computedValue, borderColor: theme.colors.gray300.computedValue, }, header: { borderBottom: `1px solid ${theme.colors["divider1-semantic"].computedValue}`, }, title: { color: theme.colors.gray900.computedValue, }, content: { color: theme.colors.gray700.computedValue, backgroundColor: theme.colors["paperContents-semantic"].computedValue, }, footer: { borderTop: `1px solid ${theme.colors["divider2-semantic"].computedValue}`, }, closeButton: { color: theme.colors.gray500.computedValue, }, submitButton: { backgroundColor: theme.colors.blue600.computedValue, color: theme.colors["white-static"].computedValue, }, }; return isOpen ? (

Dialog Title

Dialog content
) : null; }; export { semanticColors, scaleColors, staticColors, Component, Dialog }; ``` ```tsx title="basic.output.tsx" // @ts-nocheck import { theme } from "@src/stitches/stitches.config"; const semanticColors = { primary: theme.colors["bg-brand-solid"].computedValue, onPrimary: theme.colors["palette-static-white"].computedValue, primaryLow: theme.colors["palette-carrot-100"].computedValue, success: theme.colors["bg-positive-solid"].computedValue, warning: theme.colors["bg-warning-solid"].computedValue, danger: theme.colors["bg-critical-solid"].computedValue, paperDefault: theme.colors["bg-layer-default"].computedValue, paperContents: theme.colors["bg-layer-fill"].computedValue, paperDialog: theme.colors["bg-layer-floating"].computedValue, inkText: theme.colors["fg-neutral"].computedValue, inkTextLow: theme.colors["fg-neutral-subtle"].computedValue, divider1: theme.colors["stroke-neutral-subtle"].computedValue, divider2: theme.colors["stroke-neutral-muted"].computedValue, overlayDim: theme.colors["bg-overlay"].computedValue, accent: theme.colors["bg-informative-solid"].computedValue, }; const scaleColors = { gray00: theme.colors["palette-gray-00"].computedValue, gray100: theme.colors["palette-gray-200"].computedValue, gray200: theme.colors["palette-gray-300"].computedValue, gray300: theme.colors["palette-gray-400"].computedValue, gray400: theme.colors["palette-gray-500"].computedValue, gray500: theme.colors["palette-gray-600"].computedValue, gray600: theme.colors["palette-gray-700"].computedValue, gray700: theme.colors["palette-gray-800"].computedValue, gray800: theme.colors["palette-gray-900"].computedValue, gray900: theme.colors["palette-gray-1000"].computedValue, carrot100: theme.colors["palette-carrot-200"].computedValue, carrot500: theme.colors["palette-carrot-600"].computedValue, carrot900: theme.colors["palette-carrot-800"].computedValue, carrotAlpha50: theme.colors["palette-carrot-100"].computedValue, carrotAlpha100: theme.colors["palette-carrot-200"].computedValue, carrotAlpha200: theme.colors["palette-carrot-200"].computedValue, blue300: theme.colors["palette-blue-400"].computedValue, blue600: theme.colors["palette-blue-600"].computedValue, red500: theme.colors["palette-red-700"].computedValue, }; const staticColors = { white: theme.colors["palette-static-white"].computedValue, black: theme.colors["palette-static-black"].computedValue, blackAlpha200: theme.colors["palette-static-black-alpha-500"].computedValue, whiteAlpha200: theme.colors["palette-static-white-alpha-300"].computedValue, gray900: theme.colors["palette-static-black"].computedValue, carrot50: theme.colors["palette-carrot-100"].computedValue, carrot800: theme.colors["palette-carrot-700"].computedValue, blue50: theme.colors["palette-blue-100"].computedValue, blue800: theme.colors["palette-blue-700"].computedValue, red50: theme.colors["palette-red-100"].computedValue, red800: theme.colors["palette-red-700"].computedValue, }; const Component = () => { return (
Notice Important
); }; const Dialog = ({ isOpen, onClose }) => { const styles = { overlay: { backgroundColor: theme.colors["bg-overlay"].computedValue, }, container: { backgroundColor: theme.colors["bg-layer-floating"].computedValue, borderColor: theme.colors["palette-gray-400"].computedValue, }, header: { borderBottom: `1px solid ${theme.colors["stroke-neutral-subtle"].computedValue}`, }, title: { color: theme.colors["palette-gray-1000"].computedValue, }, content: { color: theme.colors["palette-gray-800"].computedValue, backgroundColor: theme.colors["bg-layer-fill"].computedValue, }, footer: { borderTop: `1px solid ${theme.colors["stroke-neutral-muted"].computedValue}`, }, closeButton: { color: theme.colors["palette-gray-600"].computedValue, }, submitButton: { backgroundColor: theme.colors["palette-blue-600"].computedValue, color: theme.colors["palette-static-white"].computedValue, }, }; return isOpen ? (

Dialog Title

Dialog content
) : null; }; export { semanticColors, scaleColors, staticColors, Component, Dialog }; ``` ## replace-css-seed-design-color-variable - npm: npx @seed-design/codemod@latest replace-css-seed-design-color-variable \ - pnpm: pnpm dlx @seed-design/codemod@latest replace-css-seed-design-color-variable \ - yarn: yarn dlx @seed-design/codemod@latest replace-css-seed-design-color-variable \ - bun: bun x @seed-design/codemod@latest replace-css-seed-design-color-variable \ ```css title="basic.input.css" :root[data-seed] { --seed-alert-dialog-backdrop-background: var(--seed-semantic-color-overlay-dim); --seed-alert-dialog-content-background: var(--seed-semantic-color-paper-dialog); --seed-alert-dialog-title-color: var(--seed-scale-color-gray-900); --seed-alert-dialog-description-color: var(--seed-scale-color-gray-900); --seed-box-button-focus-border: 2px solid var(--seed-scale-color-blue-600); box-shadow: 0 0 0 2px var(--seed-scale-color-blue-600); background: linear-gradient(to bottom, var(--seed-scale-color-blue-600), var(--seed-scale-color-blue-700)); } ``` ```css title="basic.output.css" :root[data-seed] { --seed-alert-dialog-backdrop-background: var(--seed-color-bg-overlay); --seed-alert-dialog-content-background: var(--seed-color-bg-layer-floating); --seed-alert-dialog-title-color: var(--seed-color-palette-gray-1000); --seed-alert-dialog-description-color: var(--seed-color-palette-gray-1000); --seed-box-button-focus-border: 2px solid var(--seed-color-palette-blue-600); box-shadow: 0 0 0 2px var(--seed-color-palette-blue-600); background: linear-gradient(to bottom, var(--seed-color-palette-blue-600), var(--seed-color-palette-blue-800)); } ``` ## replace-react-icon - npm: npx @seed-design/codemod@latest replace-react-icon \ - pnpm: pnpm dlx @seed-design/codemod@latest replace-react-icon \ - yarn: yarn dlx @seed-design/codemod@latest replace-react-icon \ - bun: bun x @seed-design/codemod@latest replace-react-icon \ ```tsx title="basic.input.tsx" // @ts-nocheck import { IconSellRegular, IconListFill, IconAddFill as AddIconAlias, } from "@seed-design/react-icon"; import IconSellFill from "@seed-design/react-icon/IconSellFill"; import IconAddThin from '@karrotmarket/karrot-ui-icon/lib/react/IconAddThin'; import IconCloseThin from '@karrotmarket/karrot-ui-icon/lib/react/IconCloseThin'; import IconCarRegular from '@karrotmarket/karrot-ui-icon/lib/react/IconCarRegular'; function App() { console.log(IconSellRegular); return ( <> ); } ``` ```tsx title="basic.output.tsx" // @ts-nocheck import { IconPlusSquareLine, IconDothorizline3VerticalFill, IconPlusFill as AddIconAlias, } from "@karrotmarket/react-monochrome-icon"; import IconPlusSquareFill from "@karrotmarket/react-monochrome-icon/IconPlusSquareFill"; import IconPlusLine from "@karrotmarket/react-monochrome-icon/IconPlusLine"; import IconXmarkLine from "@karrotmarket/react-monochrome-icon/IconXmarkLine"; import IconCarFrontsideLine from "@karrotmarket/react-monochrome-icon/IconCarFrontsideLine"; function App() { console.log(IconPlusSquareLine); return ( <> ); } ``` ## replace-seed-design-token-vars - npm: npx @seed-design/codemod@latest replace-seed-design-token-vars \ - pnpm: pnpm dlx @seed-design/codemod@latest replace-seed-design-token-vars \ - yarn: yarn dlx @seed-design/codemod@latest replace-seed-design-token-vars \ - bun: bun x @seed-design/codemod@latest replace-seed-design-token-vars \ ```tsx title="basic.input.tsx" import { vars as legacyVars } from "@seed-design/design-token"; import { vars } from "@seed-design/css/vars"; import { vars as typoVars } from "@seed-design/css/vars/component/typography"; const color = vars.$color.palette.gray600; const typography = typoVars.textStyleT5Bold.enabled.root; const legacyColor = legacyVars.$static.color.staticWhiteAlpha50; ``` ```tsx title="basic.output.tsx" import { vars as legacyVars } from "@seed-design/design-token"; import { vars } from "@seed-design/css/vars"; import { vars as typoVars } from "@seed-design/css/vars/component/typography"; const color = vars.$color.palette.gray600; const typography = typoVars.textStyleT5Bold.enabled.root; const legacyColor = legacyVars.$static.color.staticWhiteAlpha50; ``` ## 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 token | New token | Note | | --------------------------------- | ---------------------------------- | ---------------------- | | `vars.$color.stroke.neutralMuted` | `vars.$color.stroke.neutralSubtle` | Must be migrated first | #### General conversion (pass 2) | Old token | New token | | --------------------------------- | ------------------------------------ | | `vars.$color.stroke.onImage` | `vars.$color.stroke.neutralSubtle` | | `vars.$color.stroke.neutral` | `vars.$color.stroke.neutralMuted` | | `vars.$color.stroke.fieldFocused` | `vars.$color.stroke.neutralContrast` | | `vars.$color.stroke.control` | `vars.$color.stroke.neutralWeak` | | `vars.$color.stroke.field` | `vars.$color.stroke.neutralWeak` | | `vars.$color.stroke.brand` | `vars.$color.stroke.brandWeak` | | `vars.$color.stroke.positive` | `vars.$color.stroke.positiveWeak` | | `vars.$color.stroke.informative` | `vars.$color.stroke.informativeWeak` | | `vars.$color.stroke.warning` | `vars.$color.stroke.warningWeak` | | `vars.$color.stroke.critical` | `vars.$color.stroke.criticalWeak` | ### Supported file types - TypeScript (`.ts`) - TypeScript JSX (`.tsx`) ### Conversion examples #### Basic usage ```typescript // 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 ```tsx // Before const Component = () => (
); // After const Component = () => (
); ``` ### 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 * npm: npx @seed-design/codemod@latest replace-semantic-stroke-color \ * pnpm: pnpm dlx @seed-design/codemod@latest replace-semantic-stroke-color \ * yarn: yarn dlx @seed-design/codemod@latest replace-semantic-stroke-color \ * bun: bun x @seed-design/codemod@latest replace-semantic-stroke-color \ ```tsx title="basic.input.tsx" // @ts-nocheck import React from "react"; import { vars } from "@seed-design/css/vars"; // Using a stroke token in an inline style const Component1 = () => (
); // Used in an object style const styles = { container: { borderColor: vars.$color.stroke.control, border: `1px solid ${vars.$color.stroke.field}`, }, button: { borderColor: vars.$color.stroke.brand, outlineColor: vars.$color.stroke.positive, }, input: { borderColor: vars.$color.stroke.informative, "&:focus": { borderColor: vars.$color.stroke.warning, }, }, error: { borderColor: vars.$color.stroke.critical, }, }; // Used in a ternary expression const ConditionalComponent = ({ isActive }: { isActive: boolean }) => (
); // New tokens (should not change) const NewTokensComponent = () => (
); ``` ```tsx title="basic.output.tsx" // @ts-nocheck import React from "react"; import { vars } from "@seed-design/css/vars"; // Using a stroke token in an inline style const Component1 = () => (
); // Used in an object style const styles = { container: { borderColor: vars.$color.stroke.neutralWeak, border: `1px solid ${vars.$color.stroke.neutralWeak}`, }, button: { borderColor: vars.$color.stroke.brandWeak, outlineColor: vars.$color.stroke.positiveWeak, }, input: { borderColor: vars.$color.stroke.informativeWeak, "&:focus": { borderColor: vars.$color.stroke.warningWeak, }, }, error: { borderColor: vars.$color.stroke.criticalWeak, }, }; // Used in a ternary expression const ConditionalComponent = ({ isActive }: { isActive: boolean }) => (
); // New tokens (should not change) const NewTokensComponent = () => (
); ``` ## replace-custom-seed-design-text-component - npm: npx @seed-design/codemod@latest replace-custom-seed-design-text-component \ - pnpm: pnpm dlx @seed-design/codemod@latest replace-custom-seed-design-text-component \ - yarn: yarn dlx @seed-design/codemod@latest replace-custom-seed-design-text-component \ - bun: bun x @seed-design/codemod@latest replace-custom-seed-design-text-component \ ```tsx title="basic.input.tsx" // @ts-nocheck import Text from 'components/Base/Text'; const Component = () => { return (
{/* Existing variant prop case */} Ad display criteria We analyze your recent in-app activity to show posts relevant to your interests. {/* typography prop + color prop case */} We analyze your recent in-app activity to show posts relevant to your interests. Select region Performance by metric {/* Various typography prop forms */} Token with no prefix Another token {/* Various color prop forms */} Semantic color Static color textColor prop {/* Conditional expression case */} Conditional variant Conditional color {/* JSX expression container case */} Expression container
); }; ``` ```tsx title="basic.output.tsx" // @ts-nocheck import { Text } from "@seed-design/react"; const Component = () => { return (
{/* Existing variant prop case */} Ad display criteria We analyze your recent in-app activity to show posts relevant to your interests. {/* typography prop + color prop case */} We analyze your recent in-app activity to show posts relevant to your interests. Select region Performance by metric {/* Various typography prop forms */} Token with no prefix Another token {/* Various color prop forms */} Semantic color Static color textColor prop {/* Conditional expression case */} Conditional variant Conditional color {/* JSX expression container case */} Expression container
); }; ``` ## replace-seed-design-token-typography-classname - npm: npx @seed-design/codemod@latest replace-seed-design-token-typography-classname \ - pnpm: pnpm dlx @seed-design/codemod@latest replace-seed-design-token-typography-classname \ - yarn: yarn dlx @seed-design/codemod@latest replace-seed-design-token-typography-classname \ - bun: bun x @seed-design/codemod@latest replace-seed-design-token-typography-classname \ ```tsx title="basic.input.tsx" // @ts-nocheck import { classNames } from "@seed-design/design-token"; import { style } from "@vanilla-extract/css"; const typography = { one: classNames.$semantic.typography.title2Regular, two: classNames.$semantic.typography.label3Regular, three: classNames.$semantic.typography.label5Regular, four: classNames.$semantic.typography.label6Regular, } export const footer = style([ classNames.$semantic.typography.caption1Regular, { padding: "16px", marginTop: "12px", color: vars.$scale.color.gray700, backgroundColor: vars.$semantic.color.paperContents, }, ]); ``` ```tsx title="basic.output.tsx" // @ts-nocheck import { text } from "@seed-design/css/recipes/text"; import { style } from "@vanilla-extract/css"; const typography = { one: text({ textStyle: "t7Regular" }), two: text({ textStyle: "t4Regular" }), three: text({ textStyle: "t1Regular" }), four: text({ textStyle: "t1Regular" }), } export const footer = style([ text({ textStyle: "t3Regular" }), { padding: "16px", marginTop: "12px", color: vars.$scale.color.gray700, backgroundColor: vars.$semantic.color.paperContents, }, ]); ``` ## 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. * npm: npx @seed-design/codemod@latest replace-stitches-styled-color \ * pnpm: pnpm dlx @seed-design/codemod@latest replace-stitches-styled-color \ * yarn: yarn dlx @seed-design/codemod@latest replace-stitches-styled-color \ * bun: bun x @seed-design/codemod@latest replace-stitches-styled-color \ ```tsx title="basic.input.tsx" // @ts-nocheck const SemanticColorTestComponent = styled("div", { // Semantic Color test color: "$primary-semantic", color: "$onPrimary-semantic", color: "$primaryLow-semantic", color: "$secondary-semantic", color: "$secondaryLow-semantic", color: "$success-semantic", color: "$successLow-semantic", color: "$warning-semantic", color: "$warningLow-semantic", color: "$danger-semantic", color: "$dangerLow-semantic", color: "$overlayDim-semantic", color: "$overlayLow-semantic", color: "$paperSheet-semantic", color: "$paperDialog-semantic", color: "$paperFloating-semantic", color: "$paperContents-semantic", color: "$paperDefault-semantic", color: "$paperBackground-semantic", color: "$paperAccent-semantic", color: "$primaryHover-semantic", color: "$primaryPressed-semantic", color: "$primaryLowHover-semantic", color: "$primaryLowActive-semantic", color: "$primaryLowPressed-semantic", color: "$grayHover-semantic", color: "$grayPressed-semantic", color: "$onPrimaryOverlay50-semantic", color: "$onPrimaryOverlay200-semantic", color: "$onPrimaryLowOverlay50-semantic", color: "$onPrimaryLowOverlay100-semantic", color: "$onPrimaryLowOverlay200-semantic", color: "$onGrayOverlay50-semantic", color: "$onGrayOverlay100-semantic", color: "$divider1-semantic", color: "$divider2-semantic", color: "$divider3-semantic", color: "$accent-semantic", color: "$inkText-semantic", color: "$inkTextLow-semantic", color: "$grayActive-semantic", }); const ScaleColorTestComponent = styled("div", { // Scale Color Gray test color: "$gray00", color: "$gray50", color: "$gray100", color: "$gray200", color: "$gray300", color: "$gray400", color: "$gray500", color: "$gray600", color: "$gray700", color: "$gray800", color: "$gray900", color: "$grayAlpha50", color: "$grayAlpha100", color: "$grayAlpha200", color: "$grayAlpha500", // Scale Color Carrot test color: "$carrot50", color: "$carrot100", color: "$carrot200", color: "$carrot300", color: "$carrot400", color: "$carrot500", color: "$carrot600", color: "$carrot700", color: "$carrot800", color: "$carrot900", color: "$carrot950", color: "$carrotAlpha50", color: "$carrotAlpha100", color: "$carrotAlpha200", // Scale Color Blue test color: "$blue50", color: "$blue100", color: "$blue200", color: "$blue300", color: "$blue400", color: "$blue500", color: "$blue600", color: "$blue700", color: "$blue800", color: "$blue900", color: "$blue950", color: "$blueAlpha50", color: "$blueAlpha100", color: "$blueAlpha200", // Scale Color Red test color: "$red50", color: "$red100", color: "$red200", color: "$red300", color: "$red400", color: "$red500", color: "$red600", color: "$red700", color: "$red800", color: "$red900", color: "$red950", color: "$redAlpha50", color: "$redAlpha100", color: "$redAlpha200", // Scale Color Green test color: "$green50", color: "$green100", color: "$green200", color: "$green300", color: "$green400", color: "$green500", color: "$green600", color: "$green700", color: "$green800", color: "$green900", color: "$green950", color: "$greenAlpha50", color: "$greenAlpha100", color: "$greenAlpha200", // Scale Color Yellow test color: "$yellow50", color: "$yellow100", color: "$yellow200", color: "$yellow300", color: "$yellow400", color: "$yellow500", color: "$yellow600", color: "$yellow700", color: "$yellow800", color: "$yellow900", color: "$yellow950", color: "$yellowAlpha50", color: "$yellowAlpha100", color: "$yellowAlpha200", // Scale Color Purple test color: "$purple50", color: "$purple100", color: "$purple200", color: "$purple300", color: "$purple400", color: "$purple500", color: "$purple600", color: "$purple700", color: "$purple800", color: "$purple900", color: "$purple950", }); const StaticColorTestComponent = styled("div", { // Static Color test color: "$black-static", color: "$white-static", color: "$gray900-static", color: "$carrot50-static", color: "$carrot800-static", color: "$green50-static", color: "$green800-static", color: "$yellow50-static", color: "$yellow800-static", color: "$red50-static", color: "$red800-static", color: "$blue50-static", color: "$blue800-static", color: "$blackAlpha200-static", color: "$blackAlpha500-static", color: "$whiteAlpha50-static", color: "$whiteAlpha200-static", }); // Compound property test const ComplexPropertyTestComponent = styled("div", { border: "1px solid $gray700", boxShadow: "0 0 10px $overlayDim-semantic", outline: "2px solid $accent-semantic", textDecoration: "underline $danger-semantic", // Nested property test "&:before": { borderBottom: "1px solid $divider1-semantic", background: "$paperContents-semantic", }, // Variant test variants: { theme: { primary: { background: "$primary-semantic", color: "$onPrimary-semantic", }, secondary: { background: "$secondaryLow-semantic", color: "$inkText-semantic", }, danger: { background: "$danger-semantic", color: "$white-static", }, }, }, }); // Compound property (color token comes first) test const BorderAndColorTestComponent = styled("div", { color: "$scale-red500 solid 1px", color: "$red600 dashed 2px", color: "$scale-blue400 dotted 3px", color: "$scale-green600 double 4px", color: "$scale-yellow500 groove 2px", outlineColor: "$scale-purple500", }); const ImportantTest = styled("div", { color: "$primary-semantic !important", color: "$onPrimary-semantic !important", color: "$primaryLow-semantic !important", color: "$gray00 !important", color: "$gray50 !important", color: "$gray100 !important", css: { color: "$scale-gray600 !important", borderColor: "$scale-gray400 !important", backgroundColor: "$scale-gray100 !important", }, }); const Li_FieldItem = styled("li", { borderBottom: `${rem(1)} solid $semantic-divider1`, borderBottom: `0.5rem solid $semantic-paperBackground`, border: check ? "1px solid $semantic-divider1" : "0.5rem solid $semantic-paperBackground", }); ``` ```tsx title="basic.output.tsx" // @ts-nocheck const SemanticColorTestComponent = styled("div", { // Semantic Color test color: "$fg-brand", color: "$palette-static-white", color: "$palette-carrot-100", color: "$palette-gray-900", color: "$bg-neutral-weak", color: "$fg-positive", color: "$bg-positive-weak", color: "$bg-warning-solid", color: "$bg-warning-weak", color: "$fg-critical", color: "$bg-critical-weak", color: "$bg-overlay", color: "$bg-overlay-muted", color: "$bg-layer-floating", color: "$bg-layer-floating", color: "$bg-layer-floating", color: "$bg-layer-fill", color: "$bg-layer-default", color: "$bg-layer-basement", color: "$palette-carrot-100", color: "$bg-brand-solid-pressed", color: "$bg-brand-solid-pressed", color: "$palette-carrot-200", color: "$palette-carrot-100", color: "$palette-carrot-200", color: "$bg-neutral-weak-pressed", color: "$bg-neutral-weak-pressed", color: "$onPrimaryOverlay50-semantic", color: "$onPrimaryOverlay200-semantic", color: "$onPrimaryLowOverlay50-semantic", color: "$onPrimaryLowOverlay100-semantic", color: "$onPrimaryLowOverlay200-semantic", color: "$stroke-neutral-subtle", color: "$onGrayOverlay100-semantic", color: "$stroke-neutral-subtle", color: "$stroke-neutral-muted", color: "$palette-gray-400", color: "$fg-informative", color: "$fg-neutral", color: "$fg-neutral-subtle", color: "$fg-neutral-muted", }); const ScaleColorTestComponent = styled("div", { // Scale Color Gray test color: "$palette-gray-00", color: "$palette-gray-100", color: "$palette-gray-200", color: "$palette-gray-300", color: "$palette-gray-400", color: "$palette-gray-500", color: "$palette-gray-600", color: "$palette-gray-700", color: "$palette-gray-800", color: "$palette-gray-900", color: "$palette-gray-1000", color: "$palette-gray-200", color: "$palette-gray-300", color: "$palette-gray-500", color: "$palette-gray-700", // Scale Color Carrot test color: "$palette-carrot-100", color: "$palette-carrot-200", color: "$palette-carrot-300", color: "$palette-carrot-400", color: "$palette-carrot-500", color: "$palette-carrot-600", color: "$palette-carrot-600", color: "$palette-carrot-700", color: "$palette-carrot-700", color: "$palette-carrot-800", color: "$palette-carrot-800", color: "$palette-carrot-100", color: "$palette-carrot-200", color: "$palette-carrot-200", // Scale Color Blue test color: "$palette-blue-100", color: "$palette-blue-200", color: "$palette-blue-300", color: "$palette-blue-400", color: "$palette-blue-400", color: "$palette-blue-600", color: "$palette-blue-600", color: "$palette-blue-800", color: "$palette-blue-900", color: "$palette-blue-900", color: "$palette-blue-1000", color: "$palette-blue-100", color: "$palette-blue-100", color: "$palette-blue-200", // Scale Color Red test color: "$palette-red-100", color: "$palette-red-200", color: "$palette-red-300", color: "$palette-red-400", color: "$palette-red-600", color: "$palette-red-700", color: "$palette-red-700", color: "$palette-red-800", color: "$palette-red-900", color: "$palette-red-900", color: "$palette-red-900", color: "$palette-red-100", color: "$palette-red-200", color: "$palette-red-300", // Scale Color Green test color: "$palette-green-100", color: "$palette-green-200", color: "$palette-green-300", color: "$palette-green-400", color: "$palette-green-500", color: "$palette-green-600", color: "$palette-green-700", color: "$palette-green-800", color: "$palette-green-900", color: "$palette-green-900", color: "$palette-green-900", color: "$palette-green-100", color: "$palette-green-200", color: "$palette-green-200", // Scale Color Yellow test color: "$palette-yellow-100", color: "$palette-yellow-200", color: "$palette-yellow-300", color: "$palette-yellow-400", color: "$palette-yellow-500", color: "$palette-yellow-700", color: "$palette-yellow-700", color: "$palette-yellow-800", color: "$palette-yellow-800", color: "$palette-yellow-900", color: "$palette-yellow-900", color: "$palette-yellow-100", color: "$palette-yellow-100", color: "$palette-yellow-100", // Scale Color Purple test color: "$palette-purple-100", color: "$palette-purple-300", color: "$palette-purple-400", color: "$palette-purple-400", color: "$palette-purple-500", color: "$palette-purple-600", color: "$palette-purple-700", color: "$palette-purple-800", color: "$palette-purple-900", color: "$palette-purple-900", color: "$palette-purple-1000", }); const StaticColorTestComponent = styled("div", { // Static Color test color: "$palette-static-black", color: "$palette-static-white", color: "$palette-static-black", color: "$palette-carrot-100", color: "$palette-carrot-700", color: "$palette-green-100", color: "$palette-green-700", color: "$palette-yellow-100", color: "$palette-yellow-700", color: "$palette-red-100", color: "$palette-red-700", color: "$palette-blue-100", color: "$palette-blue-700", color: "$palette-static-black-alpha-500", color: "$palette-static-black-alpha-700", color: "$palette-static-white-alpha-50", color: "$palette-static-white-alpha-300", }); // Compound property test const ComplexPropertyTestComponent = styled("div", { border: "1px solid $palette-gray-800", boxShadow: "0 0 10px $bg-overlay", outline: "2px solid $fg-informative", textDecoration: "underline $fg-critical", // Nested property test "&:before": { borderBottom: "1px solid $stroke-neutral-subtle", background: "$bg-layer-fill", }, // Variant test variants: { theme: { primary: { background: "$bg-brand-solid", color: "$palette-static-white", }, secondary: { background: "$bg-neutral-weak", color: "$fg-neutral", }, danger: { background: "$bg-critical-solid", color: "$palette-static-white", }, }, }, }); // Compound property (color token comes first) test const BorderAndColorTestComponent = styled("div", { color: "$palette-red-700 solid 1px", color: "$palette-red-700 dashed 2px", color: "$palette-blue-400 dotted 3px", color: "$palette-green-700 double 4px", color: "$palette-yellow-700 groove 2px", outlineColor: "$palette-purple-600", }); const ImportantTest = styled("div", { color: "$fg-brand !important", color: "$palette-static-white !important", color: "$palette-carrot-100 !important", color: "$palette-gray-00 !important", color: "$palette-gray-100 !important", color: "$palette-gray-200 !important", css: { color: "$palette-gray-700 !important", borderColor: "$palette-gray-500 !important", backgroundColor: "$palette-gray-200 !important", }, }); const Li_FieldItem = styled("li", { borderBottom: `${rem(1)} solid $stroke-neutral-subtle`, borderBottom: `0.5rem solid $bg-layer-basement`, border: check ? "1px solid $stroke-neutral-subtle" : "0.5rem solid $bg-layer-basement", }); ``` ## replace-custom-text-component-color-prop - npm: npx @seed-design/codemod@latest replace-custom-text-component-color-prop \ - pnpm: pnpm dlx @seed-design/codemod@latest replace-custom-text-component-color-prop \ - yarn: yarn dlx @seed-design/codemod@latest replace-custom-text-component-color-prop \ - bun: bun x @seed-design/codemod@latest replace-custom-text-component-color-prop \ ```tsx title="basic.input.tsx" // @ts-nocheck const Component = () => { return ( <> ); }; ``` ```tsx title="basic.output.tsx" // @ts-nocheck const Component = () => { return ( <> ); }; ``` ## 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 * npm: npx @seed-design/codemod@latest replace-alpha-color \ * pnpm: pnpm dlx @seed-design/codemod@latest replace-alpha-color \ * yarn: yarn dlx @seed-design/codemod@latest replace-alpha-color \ * bun: bun x @seed-design/codemod@latest replace-alpha-color \ ```tsx title="basic.input.tsx" // @ts-nocheck import { vars } from "@seed-design/css/vars"; export const Component = () => { const styles = { overlay: { backgroundColor: vars.$color.palette.staticBlackAlpha50, }, shadow: { backgroundColor: vars.$color.palette.staticBlackAlpha200, }, darkOverlay: { backgroundColor: vars.$color.palette.staticBlackAlpha500, }, lightOverlay: { backgroundColor: vars.$color.palette.staticWhiteAlpha200, }, }; return (
Light overlay
Shadow
Dark overlay
Light overlay
Direct usage
); }; ``` ```tsx title="basic.output.tsx" // @ts-nocheck import { vars } from "@seed-design/css/vars"; export const Component = () => { const styles = { overlay: { backgroundColor: vars.$color.palette.staticBlackAlpha200, }, shadow: { backgroundColor: vars.$color.palette.staticBlackAlpha500, }, darkOverlay: { backgroundColor: vars.$color.palette.staticBlackAlpha700, }, lightOverlay: { backgroundColor: vars.$color.palette.staticWhiteAlpha300, }, }; return (
Light overlay
Shadow
Dark overlay
Light overlay
Direct usage
); }; ``` ## replace-custom-seed-design-color A transform that converts custom color tokens to Crispy format - npm: npx @seed-design/codemod@latest replace-custom-seed-design-color \ - pnpm: pnpm dlx @seed-design/codemod@latest replace-custom-seed-design-color \ - yarn: yarn dlx @seed-design/codemod@latest replace-custom-seed-design-color \ - bun: bun x @seed-design/codemod@latest replace-custom-seed-design-color \ ```ts title="basic.input.ts" // @ts-nocheck import { style } from "@vanilla-extract/css"; import { color, backgroundColor, background } from "@/shared/styles"; export const container = style({ backgroundColor: color.gray100, color: color.gray900, borderColor: color.carrot500, }); export const box = style({ background: color.gray50, color: color.red500, border: `1px solid ${color.gray300}`, }); export const alert = style({ backgroundColor: color.red50, color: color.red900, }); export const button = style({ backgroundColor: background.gray100, color: color.gray900, }); export const highlight = style({ color: color.carrot500, backgroundColor: backgroundColor.primary, }); export const primary = style({ color: color.primary, }); ``` ```ts title="basic.output.ts" // @ts-nocheck import { style } from "@vanilla-extract/css"; import { color, backgroundColor, background } from "@/shared/styles"; export const container = style({ backgroundColor: color.palette.gray200, color: color.palette.gray1000, borderColor: color.palette.carrot600, }); export const box = style({ background: color.palette.gray100, color: color.palette.red700, border: `1px solid ${color.palette.gray400}`, }); export const alert = style({ backgroundColor: color.palette.red100, color: color.palette.red900, }); export const button = style({ backgroundColor: background.palette.gray200, color: color.palette.gray1000, }); export const highlight = style({ color: color.palette.carrot600, backgroundColor: backgroundColor.bg.brandSolid, }); export const primary = style({ color: color.fg.brand, }); ``` ## replace-custom-color-to-seed-design-vars-color - npm: npx @seed-design/codemod@latest replace-custom-color-to-seed-design-vars-color \ - pnpm: pnpm dlx @seed-design/codemod@latest replace-custom-color-to-seed-design-vars-color \ - yarn: yarn dlx @seed-design/codemod@latest replace-custom-color-to-seed-design-vars-color \ - bun: bun x @seed-design/codemod@latest replace-custom-color-to-seed-design-vars-color \ ```ts title="basic.input.ts" // @ts-nocheck import { color, bg, typography, mode } from '@/src/styles/tokens'; export const container = style({ backgroundColor: color['$semantic.paperDefault'], color: color['$scale.gray900'], borderColor: color['$scale.carrot500'], }); export const box = style({ background: color['$scale.gray50'], color: color['$scale.red500'], border: `1px solid ${color['$scale.gray300']}`, }); export const alert = style({ backgroundColor: color['$scale.red50'], color: color['$scale.red900'], }); export const button = style({ backgroundColor: color['$scale.gray100'], color: color['$scale.gray900'], }); export const highlight = style({ color: color['$scale.carrot500'], backgroundColor: color['$semantic.primary'], }); export const primary = style({ color: color['$semantic.primary'], }); // Additional test cases for various mappings export const semanticColors = style({ backgroundColor: color['$semantic.primary'], color: color['$semantic.inkText'], borderColor: color['$semantic.divider1'], }); export const scaleColors = style({ background: color['$scale.gray100'], color: color['$scale.carrot600'], border: `1px solid ${color['$scale.blue500']}`, }); export const staticColors = style({ backgroundColor: color['$static.staticWhite'], color: color['$static.staticBlack'], borderColor: color['$static.staticBlackAlpha200'], }); // Test deprecated tokens with alternative export const deprecatedColors = style({ backgroundColor: color['$semantic.paperContents'], color: color['$semantic.inkTextLow'], }); // Test multiple token choices (should use first one) export const multipleChoices = style({ backgroundColor: color['$semantic.success'], color: color['$semantic.warning'], }); export const icon = { color: color['$scale.gray600'], bg: bg['$scale.gray100'], }; ``` ```ts title="basic.output.ts" // @ts-nocheck import { color, bg, typography, mode } from "@/src/styles/tokens"; export const container = style({ backgroundColor: color["bg.layerDefault"], color: color["palette.gray1000"], borderColor: color["palette.carrot600"], }); export const box = style({ background: color["palette.gray100"], color: color["palette.red700"], border: `1px solid ${color["palette.gray400"]}`, }); export const alert = style({ backgroundColor: color["palette.red100"], color: color["palette.red900"], }); export const button = style({ backgroundColor: color["palette.gray200"], color: color["palette.gray1000"], }); export const highlight = style({ color: color["palette.carrot600"], backgroundColor: color["bg.brandSolid"], }); export const primary = style({ color: color["fg.brand"], }); // Additional test cases for various mappings export const semanticColors = style({ backgroundColor: color["bg.brandSolid"], color: color["fg.neutral"], borderColor: color["stroke.neutralSubtle"], }); export const scaleColors = style({ background: color["palette.gray200"], color: color["palette.carrot600"], border: `1px solid ${color["palette.blue600"]}`, }); export const staticColors = style({ backgroundColor: color["palette.staticWhite"], color: color["palette.staticBlack"], borderColor: color["palette.staticBlackAlpha500"], }); // Test deprecated tokens with alternative export const deprecatedColors = style({ backgroundColor: color["bg.layerFill"], color: color["fg.neutralSubtle"], }); // Test multiple token choices (should use first one) export const multipleChoices = style({ backgroundColor: color["bg.positiveSolid"], color: color["bg.warningSolid"], }); export const icon = { color: color["palette.gray700"], bg: bg["palette.gray200"], }; ``` ## replace-css-seed-design-typography-variable - npm: npx @seed-design/codemod@latest replace-css-seed-design-typography-variable \ - pnpm: pnpm dlx @seed-design/codemod@latest replace-css-seed-design-typography-variable \ - yarn: yarn dlx @seed-design/codemod@latest replace-css-seed-design-typography-variable \ - bun: bun x @seed-design/codemod@latest replace-css-seed-design-typography-variable \ ```css title="basic.input.css" /* Radio Label */ .seed-radio-group[data-size="small"] [data-part="radio-label"] { margin-inline-start: var(--seed-radio-small-label-margin-inline-start); margin-block-start: var(--seed-radio-small-label-margin-block-start); font-size: var(--seed-semantic-typography-label4-regular-font-size); font-weight: var(--seed-semantic-typography-label4-regular-font-weight); line-height: var(--seed-semantic-typography-label4-regular-line-height); letter-spacing: var(--seed-semantic-typography-label4-regular-letter-spacing); } .seed-radio-group[data-size="medium"] [data-part="radio-label"] { margin-inline-start: var(--seed-radio-medium-label-margin-inline-start); margin-block-start: var(--seed-radio-medium-label-margin-block-start); font-size: var(--seed-semantic-typography-label3-regular-font-size); font-weight: var(--seed-semantic-typography-label3-regular-font-weight); line-height: var(--seed-semantic-typography-label3-regular-line-height); letter-spacing: var(--seed-semantic-typography-label3-regular-letter-spacing); } .seed-radio-group[data-size="large"] [data-part="radio-label"] { margin-inline-start: var(--seed-radio-large-label-margin-inline-start); margin-block-start: var(--seed-radio-large-label-margin-block-start); font-size: var(--seed-semantic-typography-label2-regular-font-size); font-weight: var(--seed-semantic-typography-label2-regular-font-weight); line-height: var(--seed-semantic-typography-label2-regular-line-height); letter-spacing: var(--seed-semantic-typography-label2-regular-letter-spacing); } ``` ```css title="basic.output.css" /* Radio Label */ .seed-radio-group[data-size="small"] [data-part="radio-label"] { margin-inline-start: var(--seed-radio-small-label-margin-inline-start); margin-block-start: var(--seed-radio-small-label-margin-block-start); font-size: var(--seed-font-size-t2); font-weight: var(--seed-font-weight-regular); line-height: var(--seed-line-height-t2); letter-spacing: normal; } .seed-radio-group[data-size="medium"] [data-part="radio-label"] { margin-inline-start: var(--seed-radio-medium-label-margin-inline-start); margin-block-start: var(--seed-radio-medium-label-margin-block-start); font-size: var(--seed-font-size-t4); font-weight: var(--seed-font-weight-regular); line-height: var(--seed-line-height-t4); letter-spacing: normal; } .seed-radio-group[data-size="large"] [data-part="radio-label"] { margin-inline-start: var(--seed-radio-large-label-margin-inline-start); margin-block-start: var(--seed-radio-large-label-margin-block-start); font-size: var(--seed-font-size-t5); font-weight: var(--seed-font-weight-regular); line-height: var(--seed-line-height-t5); letter-spacing: normal; } ``` ## 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. * npm: npx @seed-design/codemod@latest replace-tailwind-color \ * pnpm: pnpm dlx @seed-design/codemod@latest replace-tailwind-color \ * yarn: yarn dlx @seed-design/codemod@latest replace-tailwind-color \ * bun: bun x @seed-design/codemod@latest replace-tailwind-color \ ```tsx title="basic.input.tsx" // @ts-nocheck export function BackgroundExample() { return (
Primary Background
Primary Low Background
Hover Primary Low Background
Focus Primary Low Background
Active Primary Low Background
Scale Background
Scale Carrot Low Background
Scale Carrot Mid Background
Scale Carrot High Background
Scale Carrot High Background
Scale Carrot High Background
Scale Carrot High Background
Scale Carrot High Background
Scale Carrot High Background
Scale Carrot High Background
Scale Carrot High Background
Static Black Background
Static White Background
Static Gray900 Background
); } export function SeedBackgroundExample() { return (
Primary Background
Primary Low Background
Hover Primary Low Background
Focus Primary Low Background
Active Primary Low Background
Scale Background
Scale Carrot Low Background
Scale Carrot Mid Background
Scale Carrot High Background
Scale Carrot High Background
Scale Carrot High Background
Scale Carrot High Background
Scale Carrot High Background
Scale Carrot High Background
Scale Carrot High Background
Scale Carrot High Background
Static Black Background
Static White Background
Static Gray900 Background
); } // Class Variance Authority Example import { cva } from "class-variance-authority"; // Button component with variants const buttonVariants = cva( "inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors", { variants: { variant: { default: "bg-primary text-staticWhite hover:bg-primaryLow", destructive: "bg-danger text-staticWhite hover:bg-dangerLow", outline: "border border-gray300 bg-staticWhite text-gray900 hover:bg-gray100", secondary: "bg-seed-secondaryLow text-seed-secondary hover:bg-seed-gray200", ghost: "text-seed-primary hover:bg-seed-primaryLow", link: "text-seed-primary underline-offset-4 hover:underline", }, size: { default: "h-10 px-4 py-2", sm: "h-9 rounded-md px-3", lg: "h-11 rounded-md px-8", icon: "h-10 w-10", }, }, defaultVariants: { variant: "default", size: "default", }, } ); ``` ```tsx title="basic.output.tsx" // @ts-nocheck export function BackgroundExample() { return (
Primary Background
Primary Low Background
Hover Primary Low Background
Focus Primary Low Background
Active Primary Low Background
Scale Background
Scale Carrot Low Background
Scale Carrot Mid Background
Scale Carrot High Background
Scale Carrot High Background
Scale Carrot High Background
Scale Carrot High Background
Scale Carrot High Background
Scale Carrot High Background
Scale Carrot High Background
Scale Carrot High Background
Static Black Background
Static White Background
Static Gray900 Background
); } export function SeedBackgroundExample() { return (
Primary Background
Primary Low Background
Hover Primary Low Background
Focus Primary Low Background
Active Primary Low Background
Scale Background
Scale Carrot Low Background
Scale Carrot Mid Background
Scale Carrot High Background
Scale Carrot High Background
Scale Carrot High Background
Scale Carrot High Background
Scale Carrot High Background
Scale Carrot High Background
Scale Carrot High Background
Scale Carrot High Background
Static Black Background
Static White Background
Static Gray900 Background
); } // Class Variance Authority Example import { cva } from "class-variance-authority"; // Button component with variants const buttonVariants = cva( "inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors", { variants: { variant: { default: "bg-bg-brand-solid text-palette-static-white hover:bg-palette-carrot-100", destructive: "bg-bg-critical-solid text-palette-static-white hover:bg-bg-critical-weak", outline: "border border-palette-gray-400 bg-palette-static-white text-palette-gray-1000 hover:bg-palette-gray-200", secondary: "bg-bg-neutral-weak text-palette-gray-900 hover:bg-palette-gray-300", ghost: "text-fg-brand hover:bg-palette-carrot-100", link: "text-fg-brand underline-offset-4 hover:underline", }, size: { default: "h-10 px-4 py-2", sm: "h-9 rounded-md px-3", lg: "h-11 rounded-md px-8", icon: "h-10 w-10", }, }, defaultVariants: { variant: "default", size: "default", }, } ); ```