Skip to content

Should tailwind be an --addon option instead of a top level option? #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
RPainter8West opened this issue Feb 27, 2025 · 2 comments
Open

Comments

@RPainter8West
Copy link

Which project does this relate to?

Create Tanstack App

Describe the bug

I'm wondering if tailwind shouldn't get top billing, but instead be an add-on option?

Your Example Website or App

https://github.com/TanStack/create-tsrouter-app/

Steps to Reproduce the Bug or Issue

run the create-tsrouter-app without tailwind

Later want to add in tailwind

Expected behavior

Get an option in the addons list for tailwind

Screenshots or Videos

No response

Platform

  • OS: Windows

Additional context

No response

@jherr
Copy link
Collaborator

jherr commented Feb 27, 2025

We could do that. We can have dependencies between add-ons. For example the start add-on depends on the shadcn add-on because (in the future) its demo pages will use shadcn components. The demo pages all assume tailwind will be there. So we could have the add-ons depend on tailwind and make tailwind an add-on.

Actually... let me think about this some more. What we could do is have something like this in the add-on's info.json.

"demo-routes": [
{
  "name": "Store Demo",
  "route": "demo.store",
  "files": [ "./src/routes/demo.store.tsx.tw", "./src/lib/demo-store.ts" ],
  "dependsOn": ["tailwind"]
},
{
  "name": "Store Demo",
  "route": "demo.store",
  "files": [ "./src/routes/demo.store.tsx.uno", "./src/lib/demo-store.ts" ],
  "dependsOn": ["unocss"]
}
]

And it would only add those routes if it met all of the criteria.

So technically, yeah, could be done. But stepping back, Tailwind is so ubiquitous, is this really a problem?

@jherr
Copy link
Collaborator

jherr commented Feb 27, 2025

Maybe I'm thinking about this all wrong. Perhaps add-ons should just add the capability and that's all. They wouldn't add any example code. And then in the example directory (there is one we just haven't enabled it yet). We will have all the examples that are available if you selected the right add-ons. For example, you could have some examples that work with one type of CSS and others that work with Tailwind.

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

No branches or pull requests

2 participants