Skip to content

feat: add react-tailwind-fast template powered by UnoCSS for instant browser execution#4686

Open
MiltonAkash wants to merge 1 commit intocodesandbox:mainfrom
MiltonAkash:react-tailwind-fast
Open

feat: add react-tailwind-fast template powered by UnoCSS for instant browser execution#4686
MiltonAkash wants to merge 1 commit intocodesandbox:mainfrom
MiltonAkash:react-tailwind-fast

Conversation

@MiltonAkash
Copy link
Copy Markdown

Here is a suggested PR title and description you can use:

PR Title

feat: add react-tailwind-fast template powered by UnoCSS for instant browser execution

PR Description

What does this PR do?
This PR introduces a new react-tailwind-fast template that brings instantaneous, client-side Hot Module Replacement (HMR) to React + Tailwind projects within CodeSandbox.

Why is this needed?
Historically, standard React + Tailwind templates (like react-tailwind) rely on Vite and PostCSS plugins. Because the lightweight CodeSandbox in-browser bundler does not natively support those back-end plugins, those templates are forced to boot up as Devboxes (server VMs), resulting in noticeable boot-up delays and network latency during refreshes.

To solve this, this new template utilizes UnoCSS (@unocss/preset-uno). UnoCSS functions natively as a drop-in replacement for Tailwind that is compatible with the CodeSandbox browser environment, allowing users to write standard Tailwind utility classes while enjoying the blazing-fast speeds of a client-side sandbox.

Key Changes:

  • Template Scaffolding: Duplicated the standard react-vite-ts template into a new react-tailwind-fast workspace.
  • UnoCSS Integration: Initialized UnoCSS inside vite.config.ts, created a uno.config.ts configuration file, and injected virtual:uno.css into the React entry point (main.tsx).
  • Demonstration: Replaced the generic App.tsx styles with actual Tailwind utility classes (e.g., flex, bg-gradient-to-r, hover:opacity-80) to showcase immediate out-of-the-box compatibility.
  • Documentation: Rewrote the README.md to explicitly educate users on why UnoCSS is used in this template to bypass server Devbox latency.
  • Registry Update: Registered the new configuration securely inside the core templates.json list and updated .codesandbox/template.json.

@codesandbox
Copy link
Copy Markdown

codesandbox Bot commented Mar 28, 2026

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant