You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regenerate Tailwind CSS when page content changes during watch #349
With the Tailwind integration enabled, adding a previously unused utility class to an existing page.html or page.md during domstack watch rebuilds the HTML but does not regenerate the CSS for that utility. The class remains unstyled until the stylesheet changes or watch restarts.
Reported reproduction
Using a project configured with the Tailwind eject preset (domstack eject --css tailwind --yes, followed by dependency installation):
Start domstack watch and let the initial build finish.
Edit an existing src/page.html or src/page.md to add a Tailwind utility that was absent from the initial content scan, for example bg-fuchsia-700.
Save without modifying any stylesheet.
Observe that the page HTML updates but the corresponding utility is missing from the generated CSS.
Touch the global stylesheet or restart watch; the utility then appears.
Expected: content-only edits that introduce Tailwind utilities update the generated CSS and served styling without requiring a stylesheet edit or watch restart.
Initial investigation
The esbuild-plugin-tailwindcss loader source cited by the review, for source declaring version 2.2.0, does not register scanned content as esbuild watch dependencies. Inspection of the installed plugin also shows its CSS loader returning processed contents without watchFiles or watchDirs. Consequently, Tailwind-scanned page content may be missing from the dependency information used to trigger CSS rebuilds.
Investigate whether the fix belongs in the plugin dependency registration, DOMStack watch invalidation, or a combination. Possible approaches include exposing the scanned dependencies to esbuild or explicitly invalidating/rebundling Tailwind CSS when relevant content changes.
The end-to-end watch behavior above is reported by the review; this follow-up did not independently reproduce it.
Acceptance criteria
Add watch regression coverage for introducing a previously unused utility through edits to existing HTML and Markdown pages.
Ensure the generated CSS updates without touching CSS or restarting watch.
Keep ordinary page-only watch behavior incremental; avoid unconditional CSS rebuilds for projects without a content-scanning CSS integration.
Activity