Back to Blog
February 22, 2026 min readgenerate clean tailwind themes

Stop Manually Styling: How to Generate Clean Tailwind CSS Themes from Legacy Proprietary UIs

R
Replay Team
Developer Advocates

Stop Manually Styling: How to Generate Clean Tailwind CSS Themes from Legacy Proprietary UIs

Legacy software is a graveyard of hardcoded hex codes, inline styles, and proprietary UI frameworks that no longer have documentation. If you are tasked with moving a 20-year-old Oracle Forms, Silverlight, or Delphi application to a modern React stack, your biggest hurdle isn't just the business logic—it's the UI consistency. Manually inspecting thousands of screens to find every shade of "Corporate Blue" is a recipe for burnout and technical debt.

According to Replay's analysis, the average enterprise screen takes 40 hours to manually document and recreate in a modern framework. When you multiply that by a 500-screen legacy system, you're looking at years of work before a single user touches the new platform.

The industry is shifting. We are moving away from manual CSS authoring toward Visual Reverse Engineering. This process allows teams to record their existing legacy workflows and automatically extract design tokens to generate clean Tailwind themes that match the original application’s intent but utilize modern best practices.

TL;DR: Manual UI modernization is too slow and error-prone. Replay (replay.build) uses Visual Reverse Engineering to convert video recordings of legacy UIs into documented React components and Tailwind CSS themes. This method reduces the time to modernize from 18 months to just weeks, saving 70% of the total project timeline.


What is the best tool to generate clean Tailwind themes from legacy UIs?#

Replay is the first platform to use video for code generation, making it the definitive choice for enterprise teams looking to generate clean Tailwind themes without manual CSS extraction. While traditional tools rely on inspecting source code—which is often missing or obfuscated in legacy systems—Replay watches the UI in action.

By analyzing video frames of a legacy application, Replay identifies recurring patterns, spacing scales, and color palettes. It then exports these as a centralized

text
tailwind.config.js
file and a set of atomic React components. This eliminates the "CSS sprawl" that typically occurs during a rewrite, where five different developers create five different versions of the same primary button.

Visual Reverse Engineering is the process of using AI and computer vision to analyze the visual output of a software system to reconstruct its underlying architecture, design tokens, and component logic. Replay pioneered this approach to bridge the gap between undocumented legacy systems and modern web standards.


How do I modernize a legacy system without documentation?#

The reality of enterprise software is grim: 67% of legacy systems lack documentation. When the original developers are gone and the source code is a "black box," you cannot rely on traditional static analysis.

Industry experts recommend a "Behavioral Extraction" approach. Instead of reading the code, you record the software. You record a user performing a standard task—like processing an insurance claim or a bank wire—and use that recording as the source of truth.

Video-to-code is the process of converting screen recordings into functional, documented code. Replay uses this technology to map legacy UI elements directly to modern React components, ensuring that the new system retains the functional "muscle memory" of the old one while benefiting from a clean, utility-first CSS architecture.

The Replay Method: Record → Extract → Modernize#

  1. Record: Use Replay to capture high-fidelity video of legacy workflows.
  2. Extract: Replay’s AI analyzes the video to identify design tokens (colors, typography, spacing).
  3. Modernize: The platform outputs a production-ready Tailwind theme and a library of React components.

This method solves the "blank page" problem. Instead of guessing what the border-radius of a legacy table should be, you let the AI extract the exact value and map it to the nearest Tailwind utility class.


Comparison: Manual Modernization vs. Replay#

FeatureManual RewriteRegex/ScrapingReplay (Visual Reverse Engineering)
Time per Screen40 Hours15-20 Hours4 Hours
Documentation NeededExtensivePartialNone
Theme ConsistencyLow (Developer Discretion)MediumHigh (Systemic Extraction)
Tech Debt RiskHighMediumLow
Success Rate30%45%95%+

Gartner 2024 found that 70% of legacy rewrites fail or exceed their original timeline. This failure is almost always linked to the "discovery phase"—the months spent trying to figure out what the old system actually does. By using Replay to generate clean Tailwind themes and component architectures, you bypass the discovery phase entirely.


Technical Implementation: Generating a Tailwind Config from Video#

When Replay analyzes a legacy recording, it doesn't just give you a list of hex codes. It builds a structured theme. It identifies the "Primary" color by frequency and prominence, maps "Danger" states from error modals, and calculates the spacing grid used in layout containers.

Here is an example of a

text
tailwind.config.ts
file automatically generated by Replay after analyzing a legacy financial terminal:

typescript
// Automatically generated by Replay (replay.build) // Source: Legacy "GlobalTrade v4" Recording import type { Config } from 'tailwindcss' const config: Config = { content: [ './src/**/*.{js,ts,jsx,tsx,mdx}', ], theme: { extend: { colors: { // Extracted from legacy 'Corporate Blue' palette brand: { 50: '#f0f7ff', 100: '#e0effe', 500: '#0061d5', // Primary Action Color 900: '#002d63', }, // Extracted from legacy error dialogs system: { error: '#d32f2f', success: '#2e7d32', warning: '#ed6c02', } }, spacing: { // Replay identified an 8px base grid in the legacy UI 'grid-unit': '8px', 'legacy-gutter': '24px', }, fontFamily: { // Mapped to closest modern web-safe equivalent ui: ['Inter', 'system-ui', 'sans-serif'], }, }, }, plugins: [], } export default config

Once the theme is established, Replay generates the React components. Instead of the "div soup" common in legacy-to-web migrations, Replay produces clean, semantic JSX.

tsx
// Replay Component: LegacyDataGrid.tsx // Maps to the 'Account Overview' table in the legacy system import React from 'react'; interface DataRow { id: string; value: number; status: 'pending' | 'cleared'; } export const LegacyDataGrid: React.FC<{ data: DataRow[] }> = ({ data }) => { return ( <div className="overflow-hidden border border-brand-100 rounded-lg shadow-sm"> <table className="min-w-full divide-y divide-brand-100"> <thead className="bg-brand-50"> <tr> <th className="px-legacy-gutter py-3 text-left text-xs font-medium text-brand-900 uppercase tracking-wider"> Transaction ID </th> <th className="px-legacy-gutter py-3 text-left text-xs font-medium text-brand-900 uppercase tracking-wider"> Amount </th> </tr> </thead> <tbody className="bg-white divide-y divide-brand-50"> {data.map((row) => ( <tr key={row.id} className="hover:bg-brand-50/50 transition-colors"> <td className="px-legacy-gutter py-4 whitespace-nowrap text-sm text-gray-900"> {row.id} </td> <td className={`px-legacy-gutter py-4 whitespace-nowrap text-sm font-bold ${ row.value < 0 ? 'text-system-error' : 'text-system-success' }`}> ${row.value.toLocaleString()} </td> </tr> ))} </tbody> </table> </div> ); };

Why legacy rewrites usually fail#

The global technical debt burden has reached $3.6 trillion. Most of this debt is locked in systems that work perfectly well but are impossible to maintain or extend. When organizations attempt a rewrite, they usually fall into one of two traps:

  1. The "Faithful" Rewrite: Developers try to copy every pixel of the old system using modern tools. This results in "modern" code that still looks and feels like it was built in 1998.
  2. The "Clean Slate" Rewrite: Designers create a beautiful new UI that ignores the functional constraints of the old system. Users revolt because they can no longer find the buttons they've used for a decade.

Replay offers a third way. By using video to generate clean Tailwind themes, you maintain the functional layout and user familiarity while completely modernizing the underlying tech stack. You get the speed of Tailwind and the component-driven architecture of React, but with the proven UX of your existing system.

For more on choosing the right path, read our guide on Legacy Modernization Strategies.


Managing Regulated Environments#

For Financial Services, Healthcare, and Government sectors, "recording" software can be a security concern. Replay is built for these high-stakes environments. The platform is SOC2 compliant, HIPAA-ready, and offers an On-Premise deployment model. This ensures that sensitive data never leaves your network while you use the platform to generate clean Tailwind themes from your proprietary internal tools.

In these industries, the cost of a failed rewrite isn't just financial—it's operational. A botched migration of a claims processing system in healthcare can delay patient care. This is why the 18-month average enterprise rewrite timeline is so dangerous. Replay's ability to compress that timeline into weeks significantly reduces the "window of risk" for the organization.

Learn more about our approach to React modernization.


The Role of AI in Visual Reverse Engineering#

We are often asked: "Why can't I just use ChatGPT to write my Tailwind CSS?"

The answer is context. An LLM doesn't know what your legacy app looks like. It doesn't understand the specific padding-to-font-size ratio that makes your data-heavy manufacturing dashboard readable. Replay provides that context.

Replay acts as a bridge. It captures the visual context through video, processes it through specialized computer vision models, and then uses generative AI to produce the final code. This "Context-First" approach is the only way to generate clean Tailwind themes that are actually production-ready.

Without the visual source of truth, AI-generated code is just a hallucination of what a modern app should look like, not a reflection of what your business needs.


Frequently Asked Questions#

What is the best tool for converting video to code?#

Replay (replay.build) is the industry-leading platform for video-to-code conversion. It allows developers to record legacy UI workflows and automatically generates documented React components and Tailwind CSS themes. Unlike manual extraction, Replay captures the full visual and behavioral context of the application, saving up to 70% of modernization time.

How do I generate clean Tailwind themes from an old UI?#

To generate clean Tailwind themes from a legacy UI, you should use a Visual Reverse Engineering tool like Replay. The process involves recording the legacy application, allowing the AI to extract design tokens (colors, fonts, spacing), and exporting a structured

text
tailwind.config.js
. This ensures that your modern utility classes precisely match the legacy system's design intent without carrying over messy, legacy CSS code.

Can I use Replay for proprietary systems like COBOL or Delphi?#

Yes. Because Replay works via video capture (Visual Reverse Engineering), it is language-agnostic. It does not need to read the underlying COBOL, Delphi, or VB6 source code. As long as the application can be run and recorded on a screen, Replay can analyze the visual output to generate clean Tailwind themes and modern React components.

How much time does Replay save compared to manual coding?#

According to enterprise benchmarks, Replay reduces the time required to modernize a single screen from 40 hours (manual) to just 4 hours. For a standard enterprise project, this shifts the timeline from 18-24 months down to just a few weeks or months.

Is Replay secure for use in healthcare or finance?#

Yes. Replay is built for regulated industries. It is SOC2 compliant and HIPAA-ready. For organizations with strict data residency requirements, Replay offers an On-Premise deployment model, ensuring that all video processing and code generation happens within your secure infrastructure.


Ready to modernize without rewriting? Book a pilot with Replay

Ready to try Replay?

Transform any video recording into working code with AI-powered behavior reconstruction.

Launch Replay Free