Skip to content

fix(dashboard): explicit @source for Tailwind v4 (fixes #179)#186

Merged
Lum1104 merged 1 commit into
Lum1104:mainfrom
AsimRaza10:fix/tailwind-source-detection
May 24, 2026
Merged

fix(dashboard): explicit @source for Tailwind v4 (fixes #179)#186
Lum1104 merged 1 commit into
Lum1104:mainfrom
AsimRaza10:fix/tailwind-source-detection

Conversation

@AsimRaza10
Copy link
Copy Markdown
Contributor

Summary

Fixes #179 — dashboard renders unstyled when the plugin is installed in a gitignored directory (which is the default marketplace install path: ~/.claude/plugins/cache/..., ignored by ~/.claude/.gitignore).

Root cause

Tailwind v4 source detection walks the nearest .git via git ls-files. When the dashboard sources are inside a gitignored subtree of an ancestor repo, detection returns 0 files and the Oxide engine skips all utility generation — so the dashboard ships with @theme / @layer base only, and every element collapses to default block flow.

Fix

Add explicit @source directives in packages/dashboard/src/index.css. Per the Tailwind v4 docs, this is the supported escape hatch and is a no-op when automatic detection already works.

@import "tailwindcss";
@source "./**/*.{ts,tsx,js,jsx,html}";
@source "../index.html";

Verification

  • Production CSS bundle: ~9 KB → 55.68 KB
  • Utility selectors confirmed present in the built bundle: .flex, .grid, .absolute, .w-full, .h-full
  • pnpm --filter @understand-anything/dashboard build succeeds
  • No effect on installs where source detection already works

Test plan

  • pnpm install
  • pnpm --filter @understand-anything/dashboard build succeeds
  • Install plugin via the marketplace into the default cache path, run /understand then /understand-dashboard, and confirm the dashboard renders styled

Tailwind v4's default source detection walks the nearest .git and
collects tracked files via git ls-files. When the dashboard sources
sit inside a gitignored subtree of an ancestor repo (e.g. the default
marketplace install path ~/.claude/plugins/cache/, which is ignored by
~/.claude/.gitignore), detection returns 0 files and the Oxide engine
skips all utility generation — the dashboard renders unstyled.

Adding explicit @source directives is the supported Tailwind v4 escape
hatch and is a no-op for installs where automatic detection works.

Verified: built CSS bundle jumps from ~9 KB to ~55 KB and utility
classes (.flex, .grid, .absolute, .w-full, .h-full) are present.

Fixes Lum1104#179
@Lum1104 Lum1104 merged commit 42d70c3 into Lum1104:main May 24, 2026
1 check 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.

Dashboard CSS broken when plugin is installed in a gitignored directory (Tailwind v4 source detection fails)

2 participants