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

pass multiple input files to single --input flag #16

Closed
wants to merge 3 commits into from

Conversation

skatkov
Copy link
Collaborator

@skatkov skatkov commented Jan 3, 2025

solves #14

multiple input files (let's say test.css and test1.css) currently passed to tailwindcss executable each through a separate --input flag.

Like this:

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

But in this case, only last --input flag is being passed on and test.css will not be included in output file.

It would be correct to pass multiple files to a single --input flag. Like so:

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

I'm not sure if I got it 100% right. It would be sweet if anyone can confirm that this actually resolves the issue.

@skatkov skatkov changed the title pass multiple input files to single --input parameter pass multiple input files to single --input flag Jan 3, 2025
@skatkov skatkov requested a review from crbelaus January 3, 2025 15:20
@crbelaus
Copy link
Owner

crbelaus commented Jan 11, 2025

I've tried this manually with the Tailwind cli and it seems not to work.

I have the following files:

/* input_1.css */
body { color: red; }

/* input_2.css */
h1 { color: blue; }

Running the tailwind cli with multiple inputs (both with multiple or single --input params) processes only a single file, but not both.

# Only has the contents of input_2.css
➜ ./tailwindcss -i input_1.css -i input_2.css -o out.css && cat out.css
h1 {
  color: blue;
}

# Only has the contents of input_1.css
➜ ./tailwindcss -i input_1.css input_2.css -o out.css && cat out.css
body {
  color: red;
}

It seems that the Tailwind cli does not support combining multiple input files into a single output. As far as I know the recommendation is to have a single input file that imports both css files, and use that one.

➜ cat input.css
@import url('./input_1.css');
@import url('./input_2.css');

➜ ./tailwindcss -i input.css -o out.css && cat out.css
body {
  color: red;
}

h1 {
  color: blue;
}

@skatkov
Copy link
Collaborator Author

skatkov commented Jan 11, 2025

I made a wrong assumption, that it should be possible to provide multiple input files. I can't verify this through documentation.

It seems reasonable not to allow for multiple input files at all and default to one file. But we need to gradually deprecate the ability to define multiple inputs, issuing the warning and giving a chance for people to change.

@skatkov
Copy link
Collaborator Author

skatkov commented Jan 11, 2025

Closing in favor of #17

@skatkov skatkov closed this Jan 11, 2025
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

Successfully merging this pull request may close these issues.

2 participants