Use Case

Migrate Material UI to Tailwind CSS

MUI wraps every style in Emotion or JSS at runtime, so there are no CSS classes to search and replace. ExtractCSS sidesteps all of that by reading the computed styles straight from the browser and converting them to Tailwind utility classes.

{THE PROBLEM}

MUI's runtime CSS makes migration uniquely painful.

Material UI does not ship static class names the way Bootstrap does. Styles live inside ThemeProvider, the sx prop, styled() wrappers, and makeStyles hooks. The CSS is generated at runtime by Emotion (MUI v5) or JSS (MUI v4), producing hashed class names like css-1a2b3c4 that carry no semantic meaning.

There is no file you can open and regex through. The theme object holds design tokens as nested JavaScript, the sx prop accepts responsive arrays and callback functions, and createTheme() merges deep overrides that change how every component renders. A search-and-replace converter cannot even find the styles, let alone translate them.

Most teams attempting an MUI-to-Tailwind migration spend the first week just auditing which components use theme tokens, which use inline sx styles, and which combine both. Then they rewrite each component by hand, comparing DevTools output to Tailwind's class reference.

{THE SOLUTION}

Skip the runtime. Read what the browser already computed.

ExtractCSS does not parse your JavaScript, your theme object, or your sx props. It reads the computed styles that the browser actually applied after Emotion or JSS finished generating CSS. Every theme override, every responsive breakpoint, every styled() wrapper is already resolved into concrete CSS values by the time ExtractCSS sees them.

An MUI <Button variant="contained"> with a custom theme primary of #7c3aed becomes bg-violet-600 text-white px-4 py-1.5 rounded font-medium uppercase text-sm tracking-wider shadow-sm. Not because ExtractCSS knows MUI's component API, but because those are the pixel values the browser rendered.

It works with MUI v4, v5, and the latest v6. It works with custom themes, component overrides, and CSS modules layered on top. If the browser can render it, ExtractCSS can read it.

How it works

  1. 1

    Open your MUI app in Chrome

    Navigate to the page you want to migrate. Localhost, staging, or production all work. The extension runs in the browser, so your MUI theme and Emotion runtime are already loaded.

  2. 2

    Select the component to convert

    Activate ExtractCSS and hover over any element. A blue overlay highlights the extraction boundary. Click to capture the component and all its descendants, including MUI's internal wrapper divs and ripple layers.

  3. 3

    Tune the tolerance

    The snapper maps MUI's computed values to the nearest Tailwind design tokens. Adjust tolerance per category: colors, spacing, box-shadow, and timing curves. MUI's default spacing scale (multiples of 8px) maps cleanly to Tailwind at the "Balanced" setting.

  4. 4

    Copy the Tailwind HTML

    The output panel shows clean HTML with Tailwind classes. Use the live preview to compare against the original before pasting into your project.

Common MUI patterns and how they convert

Whether styles come from the sx prop, a theme override, or a styled() wrapper, ExtractCSS sees the same thing: computed CSS. Here is what the output looks like for common MUI components.

The sx prop and styled()

MUI's sx={{ p: 3, bgcolor: 'primary.main' }} compiles to Emotion CSS at runtime. The browser applies padding: 24px and a background color. ExtractCSS reads those values and maps them to p-6 bg-blue-700 (or whatever your theme primary resolves to). Same logic applies to styled(Box) and makeStyles.

Theme overrides and component variants

Custom createTheme() calls that override typography, palette, spacing, or individual component styles all resolve to concrete CSS before ExtractCSS sees them. A theme that sets borderRadius: 12 on all buttons produces rounded-xl in the output. No manual theme-to-config translation needed.

Grid and layout (Stack, Grid, Box)

MUI's layout components compile to flexbox or CSS grid with specific gap, direction, and alignment values. A <Stack spacing={2} direction="row"> becomes flex flex-row gap-4. The responsive spacing={{ xs: 1, md: 3 }} pattern generates media-query-scoped rules that ExtractCSS captures as responsive Tailwind prefixes.

Cards, dialogs, and paper surfaces

MUI's elevation system uses box-shadow tokens that vary by theme. A <Paper elevation={3}> carries a multi-layer shadow, border-radius, background, and padding. ExtractCSS captures every layer and snaps them to Tailwind's shadow scale. The result is a self-contained component you can drop into a Tailwind project without any MUI dependency.

Why this works better than parsing MUI source code

A source-code converter would need to understand MUI's theme structure, resolve sx prop shorthand, trace styled() composition chains, evaluate responsive arrays, and account for CSS specificity from component overrides. That is effectively rebuilding MUI's styling engine.

ExtractCSS lets the browser do all of that work. By the time it reads the DOM, Emotion has already injected the <style> tags, the cascade has resolved, and every element has concrete pixel values. There is no ambiguity about which theme token was used or how the sx prop evaluated. The browser already figured it out.

This approach also handles projects that mix MUI with plain CSS, CSS modules, or even other CSS-in-JS libraries. ExtractCSS does not care where the styles came from. It only cares what the browser rendered.

Tips for a smooth migration

  • 1.Extract at the component boundary. MUI components like AppBar, Card, and Dialog are self-contained. Extract one at a time, replace it in your codebase, and move on.
  • 2.Strip MUI's internal wrapper elements. MUI generates extra divs for ripple effects and internal layout. After extraction, you can simplify the HTML by removing wrappers that are not structurally necessary in a Tailwind component.
  • 3.Use the token panels to map your palette. MUI's default palette uses different color values than Tailwind's. The color panel shows you every value the component uses. Swap MUI's primary blue for your Tailwind theme color before copying.
  • 4.Remove MUI packages incrementally. You do not need to uninstall @mui/material on day one. Convert components section by section and drop the MUI dependency once nothing imports it.
Takes 10 Seconds to Install

Extract your first component in the next 60 seconds

Install the extension. Navigate to any website. Click the component you want. Get clean Tailwind code. It really is that simple.