Skip to content

Use explicit Tailwind source globs for app PHP, Blade, and JS#3270

Merged
retlehs merged 3 commits into
roots:mainfrom
kukac7:patch-1
Mar 9, 2026
Merged

Use explicit Tailwind source globs for app PHP, Blade, and JS#3270
retlehs merged 3 commits into
roots:mainfrom
kukac7:patch-1

Conversation

@kukac7

@kukac7 kukac7 commented Aug 7, 2025

Copy link
Copy Markdown
Contributor

Summary

This updates Tailwind @source entries to use explicit recursive globs for Sage’s project structure, while preserving PHP scanning in app/.

Why

Some classes were intermittently missing from generated CSS.
Using explicit file globs makes scan targets clearer and aligns with Tailwind/Laravel guidance, without relying on generated cache files.

Changes

  • Keep scanning PHP sources in app/:
    • @source "../../app/**/*.php";
  • Scan all Blade templates:
    • @source "../**/*.blade.php";
  • Scan JS sources:
    • @source "../**/*.js";
  • Remove cache-based source path:
    • @source "../../../../cache/acorn/framework/views/*.php"; (removed)

Result

Tailwind scans stable source files (app, Blade, JS) and avoids environment-dependent cached view paths.

@retlehs

retlehs commented Aug 7, 2025

Copy link
Copy Markdown
Member

@kukac7 What is this fixing?

@kukac7

kukac7 commented Aug 7, 2025

Copy link
Copy Markdown
Contributor Author

@retlehs it has happened to me several times that certain class were not generated, even though they were in the code.

what's more, this is also the case in the tailwind doc.

Comment thread resources/css/app.css Outdated
@retlehs retlehs changed the title fix tailwind source Use explicit Tailwind source globs for app PHP, Blade, and JS Mar 9, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@retlehs retlehs self-assigned this Mar 9, 2026
@retlehs

retlehs commented Mar 9, 2026

Copy link
Copy Markdown
Member

Pushed a small fix to your branch:

  • Removed the cache source path (../../../../cache/acorn/framework/views/*.php) — those files may not exist in CI or clean builds
  • Restored app/ PHP scanning (../../app/**/*.php) — without this, Tailwind classes in Composers/Components won't be detected
  • Kept your explicit Blade/JS globs and switched quotes to double for consistency

Also updated the PR title and description to better reflect the final change.

@retlehs retlehs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@retlehs retlehs merged commit 0d18946 into roots:main Mar 9, 2026
3 checks passed
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.

3 participants