feat: add react-tailwind-fast template powered by UnoCSS for instant browser execution#4686
Open
MiltonAkash wants to merge 1 commit intocodesandbox:mainfrom
Open
feat: add react-tailwind-fast template powered by UnoCSS for instant browser execution#4686MiltonAkash wants to merge 1 commit intocodesandbox:mainfrom
MiltonAkash wants to merge 1 commit intocodesandbox:mainfrom
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 executionPR Description
What does this PR do?
This PR introduces a new
react-tailwind-fasttemplate 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:
react-vite-tstemplate into a newreact-tailwind-fastworkspace.virtual:uno.cssinto the React entry point (main.tsx).flex,bg-gradient-to-r,hover:opacity-80) to showcase immediate out-of-the-box compatibility.