-
Notifications
You must be signed in to change notification settings - Fork 43
Description
Summary
Currently, @terrazzo/plugin-tailwind outputs a theme file that always includes @import "tailwindcss";
at the top. In some setups (monorepos, shared tokens packages, or when consumers already import Tailwind globally), this creates duplication or unwanted imports.
It would be useful to make this behavior configurable in the plugin, so projects can decide whether or not to include the @import "tailwindcss";
line.
Proposal & prior art
- Syntax
Add a new plugin option in terrazzo.config.js when configuring the Tailwind plugin. For example:
tailwind({
filename: "tailwind-theme.css",
includeTailwindImport: true // default
})
true → output file includes @import "tailwindcss";
(current behavior)
false → omit the import (useful if Tailwind is already imported elsewhere)
- Alternatives
Option A (recommended): Boolean flag (includeTailwindImport), simple, minimal change.
Option B: Always omit the import, breaking change for existing users who expect it.
- Breaking change?
If we default to true, this is not breaking (preserves current behavior).
Only users who want to suppress the import would opt into the new flag.
- Prior art
Tools like Style Dictionary allow flexible control of output templates.
PostCSS/Tailwind setups often separate concerns: apps import Tailwind globally, while design tokens packages only provide variables.
- Expected output
Current output (always):
@import "tailwindcss";
@theme {
--color-primary: #3b82f6;
}
With includeTailwindImport: false:
@theme {
--color-primary: #3b82f6;
}
Extra
- I’m willing to open a PR (see CONTRIBUTING.md)