Skip to content

Importmaps with TailwindCSS + additional CSS packages? #159

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

Closed
Mar1cX opened this issue Mar 30, 2022 · 1 comment
Closed

Importmaps with TailwindCSS + additional CSS packages? #159

Mar1cX opened this issue Mar 30, 2022 · 1 comment

Comments

@Mar1cX
Copy link

Mar1cX commented Mar 30, 2022

Hi,
As I'm currently looking into importmaps approach, how it handles js, and the handy rails 7 approach with tailwindcss-rails I've come to various blogs and documentation of how the other packages should be handled. JS part with importmaps is clear, confusion comes with the CSS part.

It seems that many ppl suggest combining ESBuild or CSSBuild to compile css packages, but it feels misleading. Another approach is to just use CSS CDN of the package, but that is the approach many tried to avoid when using compilers. In this package, it was mentioned that packages would be added to the application.tailwinds.css file.

Importing css package there wouldn't be an issue, but how do we properly use this package to get css on our projects so that we can do the import? Most likely I'm missing something but due to multiple sources and different approaches now it makes it difficult to follow up as I want to give importmaps and tailwindcss a try.

Maybe an example of such a case would be great as well, good examples are packages like: flatpickr, flowbite, daisyui, etc.
Thanks in the advance for the response.

@dhh
Copy link
Member

dhh commented Mar 30, 2022

There's no magic path with import maps and these js/css combos. You'll either have to manually download the associated CSS and place it in vendor/assets/stylesheets for reference. Or you'll have to give up on import maps and go with jsbundling + cssbundling.

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