Tutorial · 9 min read

Tailwind to Figma: Build a Design System from Your Tailwind Components

Tailwind compiles to standard CSS — which means every Tailwind component is already one paste away from becoming a native Figma layer. Here's how to extract your design tokens, convert your component library, and keep code and design in sync.

HF

HTML to Figma Team

The Tailwind–Figma Gap

Tailwind CSS has become the dominant styling system for product teams. Your entire UI vocabulary — every color, spacing value, font size, and shadow — lives in a tailwind.config file. Components are built from utility classes that reference that config directly. The result is a tightly controlled, token-driven design system in code.

Figma doesn't know any of this exists. Your design file is a separate artifact, built by hand, probably months behind the code. Designers add new screens using hardcoded color values that don't match the compiled Tailwind palette. Developers get mockups that use spacing values that don't map to any p- or gap- class. The gap compounds with every sprint.

The fix isn't a one-time import — it's a workflow. You need a way to pull your Tailwind tokens into Figma as Variables and Styles, convert your rendered components into Figma layers, and re-export on a cadence that keeps things close enough to be useful. html2design handles the conversion step; this guide covers the full workflow.

Key insight: Tailwind class names are never in the HTML that reaches Figma. By the time a browser paints a Tailwind component, all utility classes have been compiled to computed CSS values. html2design reads those resolved values — the exact hex color, the exact pixel spacing — not the class names. Your custom theme is captured automatically.

Phase 1: Extract Your Tailwind Design Tokens into Figma

Before you import components, establish your token foundation. Figma Variables and Styles are the equivalent of your tailwind.config theme — colors, typography, spacing, and shadows. Getting these in sync first means that converted components will slot naturally into your design file.

Build a token reference page

The fastest approach is to render all your tokens in the browser and convert the result. Create a simple HTML file (or a Storybook page, or a Next.js route) that displays every token from your config:

<!-- Color palette --> <div class="grid grid-cols-10 gap-2 p-4"> <div class="w-10 h-10 rounded bg-primary-50"></div> <div class="w-10 h-10 rounded bg-primary-100"></div> <div class="w-10 h-10 rounded bg-primary-200"></div> <!-- ... all shades ... --> </div> <!-- Typography scale --> <div class="space-y-2 p-4"> <p class="text-xs">text-xs — 12px</p> <p class="text-sm">text-sm — 14px</p> <p class="text-base">text-base — 16px</p> <!-- ... all sizes ... --> </div>

Open this page in your browser, copy the outerHTML from DevTools, and paste it into html2design. You'll get a Figma frame with every color rendered as a fill, every font size rendered as live text. Use the Figma eyedropper and the Inspect panel to populate your Color Styles and Text Styles — the pixel values are all there, no guessing.

Map Tailwind token categories to Figma

Not all token types map to the same Figma feature. Here's how to think about it:

Tailwind config key Figma equivalent Where to register
colors Color Variables / Color Styles Variables panel → Color collection
fontSize Text Styles Local Styles → Text
spacing Number Variables Variables panel → Number collection
borderRadius Number Variables Variables panel → Number collection
boxShadow Effect Styles Local Styles → Effects
fontFamily Text Styles (font family) Local Styles → Text

Figma Variables (available on Professional and Organization plans) are the closest parallel to Tailwind tokens — they support semantic naming, mode switching (light/dark), and aliasing. If you're on a plan without Variables, Color Styles and Text Styles cover the essential ground.

Phase 2: Convert Tailwind Components to Figma Layers

With your token foundation in place, you're ready to convert components. The workflow is the same as any other HTML-to-Figma import — you're just being systematic about what you capture and in what order.

Step 1

Run your development server

Start your app or component development environment:

# Vite (most Tailwind projects) npm run dev # Next.js npm run dev # Storybook with Tailwind npm run storybook # Plain HTML with Tailwind CLI npx @tailwindcss/cli -i ./src/input.css -o ./dist/output.css --watch # then open the HTML file in a browser

Navigate to the component you want to convert. For Storybook, use Canvas mode (the isolated story view) to get a clean component frame without Storybook's chrome around it.

Step 2

Copy the rendered outerHTML

Open DevTools (Cmd+Option+I on Mac, F12 on Windows/Linux) and switch to the Elements panel. Find the root element of the component — the outermost <div> or semantic element — right-click it, and choose Copy → Copy outerHTML.

At this point, the browser has already resolved all Tailwind classes to their computed CSS values. The bg-blue-600 class is now background-color: rgb(37, 99, 235) in the computed styles. That's what gets captured.

Step 3

Paste into html2design

In Figma, open the html2design plugin (Plugins → html2design). Switch to the Code tab, paste your copied HTML, and click Import. The plugin processes the HTML and computed CSS, then generates native Figma layers in your current file.

For a button component, you'll typically get a Frame with correct dimensions, fill color, border radius, and a Text layer with the right font, size, weight, and color. Everything that Tailwind compiled is present.

Step 4

Clean up and create a Figma Component

After import, rename the top-level frame to match your component name (e.g., Button/Primary/Default). Link the fills and text styles to the Variables and Styles you registered in Phase 1. Then convert the frame to a Figma Component (Cmd+Option+K).

Repeat the capture for each significant state: hover (trigger via DevTools Force element state → :hover), disabled, loading, destructive. Group them as Variants under a single Component Set.

Which Tailwind Styles Convert Cleanly

html2design captures the computed CSS output of whatever the browser renders. For Tailwind specifically:

Arbitrary values work perfectly. Tailwind's JIT engine generates CSS for any arbitrary value you specify. Since html2design reads computed styles — not class names — bg-[#ff6b35] captures as #FF6B35 in Figma just like any preset color. Your custom theme is fully preserved.

Maintaining Sync Between Tailwind and Figma

There is no magic sync — any workflow requires deliberate re-export when things change. But a lightweight process keeps the gap manageable.

When your tailwind.config theme changes

If you update token values — a new primary color, a revised spacing scale, a custom font — update your Figma Variables and Styles to match. The token reference page approach makes this fast: re-render the reference page with the new config, re-import it, and use the Inspect panel to read the new computed values. Update the affected Variables or Styles. Components that reference those Variables update automatically in Figma.

When a component changes visually

For significant visual updates — a redesigned button, a new card layout — re-import the component and replace the existing Figma frames. Small changes (color tweak, border radius adjustment) are often faster to fix directly in Figma, especially if your Variables are already linked. The goal isn't pixel-perfect sync on every commit; it's close enough that designers can work from accurate references.

A practical cadence

Design leads the naming. When you import Tailwind components, use Figma's component naming conventions from the start — Button/Primary/Default, not btn-primary. This makes the library navigable for designers and easy to alias in code annotations later.

Advanced: Dark Mode and Theme Variants

Tailwind's dark mode (dark: prefix) compiles to separate CSS rules activated by a class or prefers-color-scheme media query. To capture dark mode variants in Figma:

  1. Open DevTools and go to the Rendering tab (accessible via the three-dot menu → More tools → Rendering)
  2. Under Emulate CSS media feature prefers-color-scheme, select dark — or manually add the dark class to your <html> element
  3. The component re-renders with dark mode computed styles
  4. Copy its outerHTML and import it via html2design
  5. In Figma, pair the dark frame with the light frame as a Component Variant, or use Figma Variables modes to switch between them at the library level

The same approach works for other Tailwind variants that change computed output: sm: / md: responsive breakpoints (resize the DevTools viewport), focus: states (trigger via DevTools Force element state), and disabled: states (add the disabled attribute in DevTools).

Compared to Other Tailwind-to-Figma Approaches

Several tools exist for bridging Tailwind and Figma. They fall into two categories: config-reader tools that parse your tailwind.config and generate Figma tokens, and rendered-output tools like html2design that work from the browser's computed styles.

Config-reader tools are useful for the token layer — they can auto-populate Figma Variables from your config file without any browser step. The limitation is that they can't capture the visual result of your components: the layout, the hover states, the rendered icons, the exact box shadows. They give you the tokens; you still have to build the components by hand.

html2design works from the rendered output, which means you capture the full visual result — tokens applied to components in context. The trade-off is that it's manual: you import one component at a time, not the entire library in one pass. For most teams, the rendered-output approach is more useful because what designers need isn't an abstract token list — they need accurate component mockups they can work with.

For a broader comparison of HTML-to-Figma tools and which scenarios each approach fits, see our full tool comparison.

Building Your Tailwind Design System in Figma: Recommended Sequence

If you're starting from scratch — converting an existing Tailwind project into a Figma design system for the first time — work in this order:

  1. Token foundation — Import your color palette, type scale, and spacing tokens. Register them as Figma Variables and Styles.
  2. Primitive components — Buttons, inputs, badges, checkboxes, avatars. Small, reusable, high-leverage. Convert default + key states for each.
  3. Compound components — Cards, modals, dropdowns, forms. These compose from primitives you've already captured, so they're faster to clean up.
  4. Page sections — Navigation, hero, pricing, footer. Large, but only needed occasionally for design work.
  5. Full pages — Dashboard views, onboarding flows, settings screens. Import the whole page for high-fidelity reference; use the full-page import workflow for these.

Starting with primitives means each subsequent step builds on a foundation that's already in Figma. By the time you're importing page sections, you're mostly cleaning up layout rather than re-creating components from scratch.

For teams already using a React component library with Tailwind, the React component to Figma workflow combines naturally with this approach — use your Storybook or dev server to render the exact component states you need, then import them into Figma.

Frequently Asked Questions

Can I convert Tailwind CSS to Figma?

Yes. Tailwind utilities compile to standard CSS, and when you copy a rendered component from DevTools, all computed styles are included. html2design reads those resolved values — not the class names — and maps them to native Figma properties. See our guide on converting HTML to Figma for the core workflow.

How do I extract Tailwind design tokens into Figma variables?

Build a token reference page that renders every value in your tailwind.config theme (colors, font sizes, spacing, shadows). Convert that page using html2design, then use the Inspect panel to read the computed values and populate your Figma Variables and Styles manually. For full details, see Phase 1 above.

Does Tailwind's dark mode work with html2design?

Yes, but you capture light and dark as separate imports. Toggle dark mode via DevTools (Rendering tab → emulate prefers-color-scheme, or add the dark class to <html>), then re-copy the outerHTML in that state and paste it into html2design. Pair the two frames as Figma Component Variants or use Variable modes.

What is the best Figma plugin for Tailwind?

html2design captures Tailwind's actual compiled output — including your customized theme, arbitrary values, and multi-level utility overrides — not just the default config. For converting real Tailwind UIs (with all your custom design decisions applied) to editable Figma layers, rendered-output conversion gives the most accurate results. For a feature-by-feature breakdown, see our comparison page.

How do I keep Figma in sync with Tailwind changes?

Re-export components and tokens when they change visually. For theme changes, update the affected Figma Variables/Styles using the token reference page. For component changes, re-import and replace the affected frames. A per-sprint cadence works well for most teams — import new components as they ship, update tokens when the config changes.


Related Articles

Try it now

Convert your first Tailwind component in 60 seconds

Run your dev server, copy a component's outerHTML from DevTools, and paste it into html2design. Get native Figma layers with all Tailwind styles resolved — no config files, no plugins, no build step.

Install from Figma Community →

$12/mo · $96/yr · Cancel anytime

← Back to Blog