Agent skill

Tailwind To Stylex

by shadcn-labs in shadcn-labs/shadcn-cssinjs

Migrate TailwindCSS to StyleX. An agent skill from shadcn-labs/shadcn-cssinjs.

MITAuto-check passedFrontend & Design

Install Tailwind To Stylex

skills CLI
$ npx skills add shadcn-labs/shadcn-cssinjs --skill tailwind-to-stylex -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install shadcn-labs/shadcn-cssinjs tailwind-to-stylex --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/shadcn-labs/shadcn-cssinjs.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/tailwind-to-stylex .claude/skills/tailwind-to-stylex && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tailwind-to-stylex
GitHub stars
124
Token cost
~2.7k tokens
SKILL.md length
1,091 words
Files
15 (incl. references)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Migrate TailwindCSS to StyleX. An agent skill from shadcn-labs/shadcn-cssinjs.

  • Works in 7 steps: Confirm StyleX is set up → Find the Tailwind usage → Build the stylex.create object → …
  • Converting Tailwind className utility strings into StyleX stylex.create + stylex.props/stylex.attrs — a single component
  • SKILL.md covers The core mechanic: resolve,…, Two things that trip up…, Workflow and Worked example, plus 1 more section
  • Runs TypeScript scripts from its folder

What it does

Tailwind To Stylex is an agent skill from shadcn-labs/shadcn-cssinjs. Migrate TailwindCSS to StyleX. Use when converting Tailwind className utility strings into StyleX stylex.create + stylex.props/stylex.attrs — a single component or a whole codebase, in React/JSX/TSX, react-strict-dom, or any JS framework StyleX supports (Solid, Svelte, Vue, Qwik, Preact, …) — when the user mentions tailwind-to-stylex or tw-to-stylex, or when they have something "in Tailwind" and want it "in StyleX", even if they don't name this skill.

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 23 other files, including reference files (for example `evals/evals.json`, `evals/files/button/package.json` and `evals/files/button/src/lib/utils.ts`). Compatibility notes: Any JavaScript-framework project (React, Preact, Solid, Svelte, Vue, Qwik, react-strict-dom, …) with StyleX (@stylexjs/stylex) and its compiler plugin…

It sits in Frontend & Design, covering CSS and styling and React components. It works with Tailwind CSS, React, Preact and Svelte. The repository describes itself as: CSS-in-JS port of shadcn/ui, built on StyleX. The licence is MIT.

When your agent uses it

  • Converting Tailwind className utility strings into StyleX stylex.create + stylex.props/stylex.attrs — a single component
  • A whole codebase
  • In React/JSX/TSX
  • React-strict-dom

Example prompts

  • “in Tailwind”
  • “in StyleX”
  • “/tailwind-to-stylex”

Requirements

  • Node.js
  • Compatibility (from SKILL.md): Any JavaScript-framework project (React, Preact, Solid, Svelte, Vue, Qwik, react-strict-dom, …) with StyleX (@stylexjs/stylex) and its compiler plugin configured. If StyleX isn't set up yet, see references/stylex-rules.md ("Project setup").

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Confirm StyleX is set up
  2. Find the Tailwind usage
  3. Build the stylex.create object
  4. Apply the styles
  5. Repeated design tokens (optional)
  6. Flag what didn't convert
  7. Verify

What it can do on your machine

Read from SKILL.md and the folder at commit 08a2e9f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (TypeScript, from the files we listed), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Any JavaScript-framework project (React, Preact, Solid, Svelte, Vue, Qwik, react-strict-dom, …) with StyleX (@stylexjs/stylex) and its compiler plugin configured. If StyleX isn't set up yet, see references/stylex-rules.md ("Project setup").

    From compatibility in the SKILL.md frontmatter.

Context cost

Tailwind To Stylex loads about 2.7k tokens when it runs, and up to ~6.5k if it reads all its reference files. Until then it costs about 121 tokens; SKILL.md has 1,091 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~121
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from shadcn-labs/shadcn-cssinjs at commit 08a2e9f, republished under its MIT licence (© shadcn-labs). 1,091 words, ~2,652 tokens.

Download SKILL.mdSave it as .claude/skills/tailwind-to-stylex/SKILL.md (or your agent's skills folder). This skill also uses 14 other files; get the full folder from GitHub.
name
tailwind-to-stylex
description
Migrate TailwindCSS to StyleX. Use when converting Tailwind `className` utility strings into StyleX `stylex.create` + `stylex.props`/`stylex.attrs` — a single component or a whole codebase, in React/JSX/TSX, react-strict-dom, or any JS framework StyleX supports (Solid, Svelte, Vue, Qwik, Preact, …) — when the user mentions tailwind-to-stylex or tw-to-stylex, or when they have something "in Tailwind" and want it "in StyleX", even if they don't name this skill.
compatibility
Any JavaScript-framework project (React, Preact, Solid, Svelte, Vue, Qwik, react-strict-dom, …) with StyleX (@stylexjs/stylex) and its compiler plugin configured. If StyleX isn't set up yet, see references/stylex-rules.md ("Project setup").

Migrate Tailwind to StyleX

Convert Tailwind utility classes into StyleX styles: replace className="..." strings with entries in a stylex.create({...}) call, and apply them with stylex.props(...).

This is a behavior-preserving refactor, not a redesign. The rendered pixels should not change. Don't drop styles you can't cleanly convert — flag them (see Step 6) so the user can decide, rather than silently changing the design.

The core mechanic: resolve, then reshape

The reliable way to convert a class string is the same one the tw-to-stylex codemod uses under the hood: resolve each class to the CSS it actually produces, then reshape that CSS into a StyleX object. Don't pattern-match class names to guesses — think in the computed CSS, because that's what has to stay identical.

"px-4 py-2 text-sm font-medium hover:bg-blue-600"
        │
        ▼   resolve to CSS (mind the project's Tailwind version + config)
padding-inline: 1rem; padding-block: .5rem;
font-size: .875rem; line-height: 1.25rem; font-weight: 500;
:hover { background-color: #2563eb }
        │
        ▼   reshape to StyleX (camelCase, conditions as values)
{
  paddingInline: '1rem',
  paddingBlock: '0.5rem',
  fontSize: '0.875rem',
  lineHeight: '1.25rem',
  fontWeight: 500,
  backgroundColor: { default: null, ':hover': '#2563eb' },
}

If a class uses arbitrary values (w-[37px]), the project's custom theme, or a plugin, resolving-to-CSS still works — you read the value straight out of the class or the config. When unsure what a class computes to (custom config, unfamiliar plugin), check the project's tailwind.config / CSS @theme, or resolve it rather than guessing.

Two things that trip up conversions

1. StyleX conditions are values, not rules. Tailwind spreads state and responsive variants across separate rules (hover:, md:, dark:). StyleX instead nests the condition inside the property value, and the default key is required whenever a property has any condition (use null when there's no base value). This is the single biggest shape difference — get it wrong and styles silently don't apply.

tsx
// md:flex hover:opacity-80  ->  conditions live on each property
display: { default: 'block', '@media (min-width: 768px)': 'flex' },
opacity: { default: 1, ':hover': 0.8 },

2. Some Tailwind utilities compile to selectors StyleX can't express on one element. space-x-*, divide-*, group/group-hover:*, peer/peer-*:*, and typography's prose all rely on descendant, sibling, or ancestor-state selectors. StyleX styles a single element, so these don't map 1:1. Don't fake them — restructure (e.g. space-x → gap on the flex parent; group-hover → lift state into React or a CSS variable) and tell the user. See references/mapping.md for each case.

Workflow

Work one component (file) at a time so each stays reviewable.

Step 1: Confirm StyleX is set up

StyleX needs its compiler plugin wired into the bundler (Babel/Vite/Next/Webpack/rspack) and @stylexjs/stylex installed — otherwise stylex.props returns nothing at runtime and the migration looks broken. Check package.json and the bundler config. If it isn't set up, read references/stylex-rules.md → "Project setup" and either configure it or tell the user what's missing before converting. Note whether the target is React DOM or react-strict-dom (React Native) — it changes how styles are applied (see the react-strict-dom note in references/stylex-rules.md → "Project setup").

Step 2: Find the Tailwind usage

Locate every className/class in the file, including dynamic ones: cn(...), clsx(...), twMerge(...), template literals, and ternaries. You need the complete set of classes that can apply to each element, and under which conditions, to convert faithfully.

Step 3: Build the stylex.create object

Create one named entry per distinct element/variant (base, label, iconActive…) — descriptive names beat $1, $2. For each, resolve its classes to CSS and reshape (the core mechanic). Apply the StyleX authoring rules that differ from raw CSS:

  • camelCase every property (border-radius → borderRadius).
  • Longhand + single-value shorthands only. StyleX warns on multi-value shorthands because they cause merge conflicts. Split them: border: '1px solid red' → borderWidth: 1, borderStyle: 'solid', borderColor: 'red'; a two-value padding → paddingBlock / paddingInline. A single-value shorthand (padding: 16) is fine.
  • Numbers are px. width: 24 means 24px. Keep other units as strings ('1.5rem', '50%', '100vh').
  • Conditions as values with a required default (see gotcha 1). Mobile-first: the unprefixed class is default; sm/md/lg/xl/2xl become @media (min-width: …) keys.
  • Full modifier → condition table (states, dark mode, first/last, before/after, arbitrary values, gradients, animations) lives in references/mapping.md — read it whenever you hit anything past plain utilities.
Show full SKILL.md (498 more words)Show less
Step 4: Apply the styles

Steps 1–3 are identical for every framework — StyleX is framework-agnostic, and only applying the result differs. First pick the applicator for the target:

  • React and JSX-spread frameworks (React DOM, Preact, react-strict-dom): spread stylex.props(...), which returns { className, style }.
  • Solid, Svelte, Vue, Qwik, and other non-React frameworks: use stylex.attrs(...) instead — it returns a plain class string and a string style value to bind onto the element. Which styles you pass and in what order is exactly the same as props.

Then, whichever applicator you use:

  • Host elements (div, span, button — lowercase): apply the result directly, replacing the old className / class.
  • Components (capitalized): they don't accept stylex.props/attrs output directly. Pass the style tokens down (e.g. a style prop) and let the component apply them on its own host element. Don't just dump the applicator output onto a component and assume it works.
  • Preserve conditional composition. The applicator merges left-to-right, last wins — the same order semantics as cn(...). So cn('base', isActive && 'active') becomes stylex.props(styles.base, isActive && styles.active) (or stylex.attrs(...)), and a passed-in override stays last so callers can still win.
Step 5: Repeated design tokens (optional)

If the same theme value (a brand color, a spacing step) recurs across the file or the project uses semantic tokens, consider stylex.defineVars in a .stylex.ts file instead of hardcoding — this is also the clean answer to class-based dark: theming (createTheme). See references/stylex-rules.md → "Theming with variables". Don't force this for one-off values.

Step 6: Flag what didn't convert

Call out, in your summary, anything you couldn't map 1:1: the selector-based utilities from gotcha 2, any class you couldn't resolve, and any place you restructured markup. Losing a hover/dark/responsive style silently is the failure that matters most here.

Step 7: Verify

Typecheck and run the linter on the changed files. If the project has the StyleX ESLint plugin, it catches invalid shorthands, missing default, and unknown properties — fix what it reports. Confirm no stray className / Tailwind imports remain on migrated elements, and remove Tailwind directives/config only once the whole codebase is migrated (not per-file). If deps aren't installed in your environment, say so and mark the check as structural rather than claiming it runs.

Worked example

tsx
// Before
import { cn } from '@/lib/utils'

export function Badge({ active, className }: Props) {
  return (
    <span
      className={cn(
        'inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold',
        active ? 'bg-green-100 text-green-800' : 'bg-gray-100 text-gray-600',
        className,
      )}
    >
      Status
    </span>
  )
}
tsx
// After
import * as stylex from '@stylexjs/stylex'

const styles = stylex.create({
  base: {
    display: 'inline-flex',
    alignItems: 'center',
    borderRadius: '9999px',
    paddingInline: '0.625rem',
    paddingBlock: '0.125rem',
    fontSize: '0.75rem',
    lineHeight: '1rem',
    fontWeight: 600,
  },
  active: { backgroundColor: '#dcfce7', color: '#166534' },
  inactive: { backgroundColor: '#f3f4f6', color: '#4b5563' },
})

export function Badge({ active, style }: Props) {
  return (
    <span
      {...stylex.props(styles.base, active ? styles.active : styles.inactive, style)}
    >
      Status
    </span>
  )
}

Note what changed: text-xs carried two declarations (font-size and line-height) — both were kept. The caller override moved from className to style (StyleX passes styles, not class strings). The cn ternary became a stylex.props ternary with identical last-wins order. This example is React; in Solid/Svelte/Vue/Qwik the styles object is byte-for-byte the same — only the stylex.props call becomes stylex.attrs and you bind the returned class/style the way that framework binds attributes.

Reference files

  • references/mapping.md — Tailwind modifier/variant → StyleX condition table, and how to handle the tricky utilities (space-x, divide, group/peer, dark mode, arbitrary values, gradients, before/after, animations, sr-only). Read it for anything beyond plain single-value utilities.
  • references/stylex-rules.md — StyleX authoring rules, common mistakes, project setup, framework support (stylex.props vs stylex.attrs), and theming with defineVars/createTheme. Read it when setting up StyleX, migrating a non-React framework, or when the ESLint plugin flags something.

© shadcn-labs, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 14 other files (references) in .agents/skills/tailwind-to-stylex of shadcn-labs/shadcn-cssinjs.

  • SKILL.md
  • evals/evals.json
  • evals/files/button/package.json
  • evals/files/button/src/Button.tsx
  • evals/files/button/src/Spinner.tsx
  • evals/files/button/src/lib/utils.ts
  • evals/files/navbar/package.json
  • evals/files/navbar/src/Navbar.tsx
  • evals/files/navbar/tailwind.config.ts
  • evals/files/price-card/package.json
  • evals/files/price-card/src/PriceCard.tsx
  • evals/files/price-card/vite.config.ts
  • … and 3 more

Open the folder on GitHubat commit 08a2e9f

Compare with similar skills

Tailwind To Stylex next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Tailwind To Stylex compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Tailwind To Stylex this skillshadcn-labs/shadcn-cssinjs124—~2.7kAutomated safety check: PassMIT
Atlaspacifio/ui154—~2.5kAutomated safety check: PassMIT
Kill AI Slopyetone/kill-ai-slop1.3k—~1.4kAutomated safety check: PassApache-2.0
Design StyleCastor6/tactus3761 repos~2.1kAutomated safety check: PassApache-2.0
UI UX Pro Maxsundial-org/awesome-openclaw-skills6632 repos~657Automated safety check: PassNone
GlideSrivarsanK/Glide120—~1.7kAutomated safety check: PassApache-2.0

Similar skills

  • Atlas

    pacifio/ui

    Atlas — a design language and UI guide system for agent interfaces.

    154 GitHub stars~2.5k tokensUpdated 5 mo ago
    Frontend & DesignAuto-check passed
  • Kill AI Slop

    yetone/kill-ai-slop

    Find and remove AI slop — the generic, machine-default visual and copy tics of vibe-coded products — from a web project.

    1.3k GitHub stars~1.4k tokensUpdated 26 days ago
    Frontend & DesignAuto-check passed
  • Design Style

    Castor6/tactus

    A skill your agent uses whenever the user asks to build, create, design, develop, improve, or style any frontend interface or visual element.

    376 GitHub starsUsed in 1 repo~2.1k tokens
    Frontend & DesignAuto-check passed
  • UI UX Pro Max

    sundial-org/awesome-openclaw-skills

    UI/UX design intelligence and implementation guidance for building polished interfaces.

    663 GitHub starsUsed in 2 repos~657 tokens
    Frontend & DesignAuto-check passed
  • Glide

    SrivarsanK/Glide

    Authoritative guide and toolset for AI agents to operate, configure, and visually design applications using Glide (@srivarsank/glide).

    120 GitHub stars~1.7k tokensUpdated 10 days ago
    Frontend & DesignAuto-check passed
  • Tailwind CSS Patterns

    ever-works/ever-works

    Provides comprehensive Tailwind CSS utility-first styling patterns including responsive design, layout utilities, flexbox, grid, spacing, typography, colors, and modern CSS best practices.

    162 GitHub starsUsed in 3 repos~1.6k tokens
    Frontend & DesignAuto-check: notes

Questions about Tailwind To Stylex

What does Tailwind To Stylex do?

Migrate TailwindCSS to StyleX. An agent skill from shadcn-labs/shadcn-cssinjs. Tailwind To Stylex is an agent skill from shadcn-labs/shadcn-cssinjs. Migrate TailwindCSS to StyleX.

When should I use Tailwind To Stylex?

Tailwind To Stylex fits situations like: converting Tailwind className utility strings into StyleX stylex.create + stylex.props/stylex.attrs — a single component; A whole codebase; in React/JSX/TSX; React-strict-dom.

How do I install Tailwind To Stylex in Claude Code?

Run `npx skills add shadcn-labs/shadcn-cssinjs --skill tailwind-to-stylex -a claude-code`. Or copy the skill folder (.agents/skills/tailwind-to-stylex in shadcn-labs/shadcn-cssinjs) into .claude/skills/tailwind-to-stylex in your project. Claude Code loads it when a task matches its description.

How do I install Tailwind To Stylex in Codex?

Run `npx skills add shadcn-labs/shadcn-cssinjs --skill tailwind-to-stylex -a codex`. Or copy the skill folder (.agents/skills/tailwind-to-stylex in shadcn-labs/shadcn-cssinjs) into .agents/skills/tailwind-to-stylex in your project. Codex loads it when a task matches its description.

Can I use Tailwind To Stylex in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add shadcn-labs/shadcn-cssinjs --skill tailwind-to-stylex -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tailwind-to-stylex, .gemini/skills/tailwind-to-stylex, .github/skills/tailwind-to-stylex and .opencode/skills/tailwind-to-stylex in your project.

What does Tailwind To Stylex need to run?

Going by SKILL.md and its folder, Tailwind To Stylex needs TypeScript for the scripts in its folder. Our summary lists: Node.js. Compatibility (from SKILL.md): Any JavaScript-framework project (React, Preact, Solid, Svelte, Vue, Qwik, react-strict-dom, …) with StyleX (@stylexjs/stylex) and its compiler plugin configured. If StyleX isn't set up yet, see references/stylex-rules.md ("Project setup")..

Does Tailwind To Stylex access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Tailwind To Stylex safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Tailwind To Stylex use?

Tailwind To Stylex is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Tailwind To Stylex use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.8k tokens, read only when the agent opens those files.

What are the alternatives to Tailwind To Stylex?

Skills that share tags, products or a category with Tailwind To Stylex: Atlas (pacifio/ui, 154 stars), Kill AI Slop (yetone/kill-ai-slop, 1.3k stars), Design Style (Castor6/tactus, 376 stars) and UI UX Pro Max (sundial-org/awesome-openclaw-skills, 663 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Tailwind To Stylex?

shadcn-labs (a GitHub organization) maintains it in shadcn-labs/shadcn-cssinjs, which has 124 GitHub stars. The repository was last updated on September 11, 2026.

Source: shadcn-labs/shadcn-cssinjs on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.