Skip to content
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

Autogenerated 'tailwind.config.js' isn't compatible with workspace paths #23

Open
tonky opened this issue Apr 29, 2024 · 3 comments
Open

Comments

@tonky
Copy link

tonky commented Apr 29, 2024

Hi, and thanks for the Leptos - learning it and enjoying the rust full-stack idea!

So i went with start-axum-workspace template, added tailwind-input-file = "style/tailwind.css" to workspace Cargo.toml and then spent some debugging and wondering why no styles from app/src/lib.rs are in the output css, when main.scss and tailwind.css are clearly being processed.

I don't have much experience with Tailwind and its configuration file, which certainly added to my confusion.

Took me a while to realize that a ./src/**/*.rs path in module.exports.content.files in 'tailwind.config.js' won't actually process any Rust files, since we're in a workspace without ./src dir. After changing it to ./app/src/**/*.rs - everything works as intended now.

So the question is - should this be fixed, and if so - what would the fix be:

  • change generated version to ./*/src/**/*.rs
  • try to detect that we're in workspace and add ./app/src/**/*.rs if that's the case
  • something else?

I can try and add PR, but this needs feedback with decision, and maybe some guidance.

@beemdvp
Copy link

beemdvp commented May 20, 2024

Just came across this, thanks for flagging this haha. I felt like I would spend hours thinking what I did wrong

@benwis
Copy link

benwis commented Jul 14, 2024

The tailwind cli isn't autogenerated, it's a static file in the start-axum-workspace template. So I'll move this issue there. A PR to fix this would be most welcome

@benwis benwis transferred this issue from leptos-rs/cargo-leptos Jul 14, 2024
@gbj
Copy link
Contributor

gbj commented Jul 23, 2024

@benwis There's no tailwind.config.js in this repo, looks like Tailwind config is generated by cargo-leptos here.

Editing to add: I'd suggest that just adding /*/src/**/*.rs to the list should cover most workspace cases but there may be a better solution.

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

4 participants