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

Using multiple Inputs is broken. #14

Open
3213-cmd opened this issue Dec 22, 2024 · 3 comments
Open

Using multiple Inputs is broken. #14

3213-cmd opened this issue Dec 22, 2024 · 3 comments

Comments

@3213-cmd
Copy link

3213-cmd commented Dec 22, 2024

I am not a ruby expert, so I apologize if I can not give more detailed information.

But it seems like when specyfing multiple inputs that only the last one is processed. I assume that is because the tailwindcli simply takes the last --input parameter as input.

I was able to get arround the issue, by specyfing a "main.css" which uses @import declarations

@crbelaus
Copy link
Owner

I was able to get arround the issue, by specyfing a "main.css" which uses https://github.com/import declarations

This is the standard and recommended approach if you are trying to compile multiple input files into a single output file.

This would not work if you are trying to compile multiple input files into multiple output files, as we would have to invoke the TailwindCSS cli multiple times (one per input/output pair). That would require configuration changes, as we only accept a single output setting at the moment.

@skatkov
Copy link
Collaborator

skatkov commented Jan 3, 2025

But it seems like when specyfing multiple inputs that only the last one is processed. I assume that is because the tailwindcli simply takes the last --input parameter as input.

Which version of jekyll-tailwind are you using? It should be possible to define multiple input source, but those will be compiled down to a single output file.

Here is a related code:
https://github.com/crbelaus/jekyll-tailwind/blob/main/lib/jekyll-tailwind.rb#L33-L36

@skatkov
Copy link
Collaborator

skatkov commented Jan 3, 2025

This might be a mistake on my part, multiple input files (let's say test.css and test1.css) currently passed to tailwindcss executable each through --input flag.

Like this:

tailwindcss --input test.css --input test2.css --output out.css

First input flag is being overwritten by a second one. And this is why only last input file is being used.

Instead it's correct to pass multiple files to a single --input flag. Like so:

tailwindcss --input test.css test2.css --output out.css

I'm not 100% sure that this is how it should be. But maybe @3213-cmd you can verify it on your project? Here is a PR that I prepared with this change:
#16

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

3 participants