mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-18 11:49:41 +02:00
Each consuming app was duplicating eight @source directives with hand- counted relative paths (../../../../../packages/…). The mana web app's were off-by-one for months before anyone noticed, silently disabling the scan for every shared-ui file. Tailwind v4 resolves @source paths relative to the CSS file that declares them, so we can drop the list once into packages/shared-tailwind/src/ sources.css. Consumer apps now just add one more @import next to themes.css: @import "tailwindcss"; @import "@mana/shared-tailwind/themes.css"; @import "@mana/shared-tailwind/sources.css"; New package.json export: "./sources.css". Drop the local paths from the mana web app's app.css. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
26 lines
1 KiB
CSS
26 lines
1 KiB
CSS
/**
|
|
* Shared Tailwind source-scan list.
|
|
*
|
|
* Apps that consume our @mana/shared-* UI packages need Tailwind to scan
|
|
* those packages for utility classes (including arbitrary-value ones like
|
|
* `bg-[hsl(var(--color-muted))]`). Keeping the `@source` list in each app's
|
|
* app.css duplicates it and invites off-by-one path bugs — which is exactly
|
|
* what happened (`../../../../` instead of `../../../../../` meant Tailwind
|
|
* scanned nothing in shared packages, silently).
|
|
*
|
|
* Tailwind v4 resolves `@source` paths relative to the CSS file that
|
|
* declares them, so centralizing here means consumer apps just do:
|
|
*
|
|
* @import "tailwindcss";
|
|
* @import "@mana/shared-tailwind/themes.css";
|
|
* @import "@mana/shared-tailwind/sources.css";
|
|
*
|
|
* and the paths Just Work regardless of how deep the consuming app lives.
|
|
*/
|
|
|
|
@source "../../shared-ui/src";
|
|
@source "../../shared-auth-ui/src";
|
|
@source "../../shared-branding/src";
|
|
@source "../../shared-theme-ui/src";
|
|
@source "../../subscriptions/src";
|
|
@source "../../credits/src";
|