Skip to content

tailwindcss CLI looks at .gitignore files from outside of current repo #15804

@samf

Description

@samf

What version of Tailwind CSS are you using?

v4.0.0-beta.8

What build tool (or framework if it abstracts the build tool) are you using?

Just a super simple static web page with a shell script that invokes the CLI

What version of Node.js are you using?

v23.6.1

What browser are you using?

Safari and Firefox

What operating system are you using?

macOS 15.1.1

Reproduction URL

https://github.com/samf/v4bug

...but, the issue won't reproduce unless you clone this below a directory that has a problematic .gitignore file within.

Describe your issue

A previous discussion is here: #15753

The problem I was having was that npx tailwindcss -i ./content/main.css -o ./public/main.css wasn't reading my content/index.html file. The repo above (v4bug) worked when someone jumped in and tried it, but not for me.

I switched to a Linux environment, and it still failed for me, but when I created a new account on the Linux machine, it worked! Cloning my v4bug repo into /tmp, rather than under my home, also fixed the problem.

Long story short, my home directory has a .gitignore file in it, the entire contents of which is *. I do this so that I can keep my home directory under git, but not have it pester me to add things I don't want. Anyway, tailwindcss seems to look at .gitignore files. This is fine, but perhaps it is climbing up the directory tree too far?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions