Skip to content

Patch css hot reload ss2#2147

Open
madaxen86 wants to merge 2 commits into
solidjs:mainfrom
madaxen86:patch-css-hot-reload-ss2
Open

Patch css hot reload ss2#2147
madaxen86 wants to merge 2 commits into
solidjs:mainfrom
madaxen86:patch-css-hot-reload-ss2

Conversation

@madaxen86
Copy link
Copy Markdown
Contributor

@madaxen86 madaxen86 commented May 20, 2026

PR Checklist

Please check if your PR fulfills the following requirements:

  • Addresses an existing open issue: fixes #19818 at tailwindlabs
  • Tests for the changes have been added (for bug fixes / features)

What is the current behavior?

When adding classes to file routes/layouts tailwind does not hot reload the css file.

This PR invalidates css modules when a file route is changed.

REPRODUCTION

  1. pnpm create solid, choose with-tailwindcss template
  2. go to src/routes/index.tsx
  3. change e.g. h1 class text-sky-500 to text-purple-500
    ==> blue color is removed ✅, purple is not added ❌

@netlify
Copy link
Copy Markdown

netlify Bot commented May 20, 2026

Deploy Preview for solid-start-landing-page ready!

Name Link
🔨 Latest commit 054b7e8
🔍 Latest deploy log https://app.netlify.com/projects/solid-start-landing-page/deploys/6a0d7f97a3f0980008659456
😎 Deploy Preview https://deploy-preview-2147--solid-start-landing-page.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 20, 2026

⚠️ No Changeset found

Latest commit: 054b7e8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 20, 2026

Open in StackBlitz

npm i https://pkg.pr.new/solidjs/solid-start/@solidjs/start@2147
npm i https://pkg.pr.new/solidjs/solid-start/@solidjs/vite-plugin-nitro-2@2147

commit: 054b7e8

@katywings
Copy link
Copy Markdown
Contributor

Hey @madaxen86, thank you a lot for the fix! What are the exact reproduction steps needed, were the hot reload for css did not work? You linked an issue regarding Tailwind, does this only relate to Tailwind or can it be reproduced without it?

When looking at the implementation, it seems as if this fix reloads each and every css file, not only the ones related to routes? Why is it necessary to reload all css 😅?

@madaxen86
Copy link
Copy Markdown
Contributor Author

Added the repro to the description.

NOTE: PR is not ready to be merged. Just needed a pkg.pr.new to test on stackblitz.
Interestingly, this PR works locally but not on stackblitz!?

This is specifically related to tailwindcss (and probably pandacss) where there are no css files changed directly, you just apply the atomic classes in tsx/jsx files.

Hot updates work with Vite v6.

I am still investigating and I'll ping you when I find a solutions that's actually applicable. Reloading all css modules is overkill of course. I just don't get why even that does not work in stackblitz!?

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.

2 participants