Skip to content

Prevent Tailwind CSS executables from detecting themselves as sources #20134

@rozsazoltan

Description

@rozsazoltan

What version of Tailwind CSS are you using?

v4.3.0

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

Standalone TailwindCSS executable

Reproduction URL

  1. Create a fresh directory.
  2. Place the standalone Tailwind CSS executable inside the project directory.
  3. Create input.css:
@import "tailwindcss";
  1. Make sure the executable file contains Tailwind-like class names internally, for example text-red-500, grid, or flex.
  2. Run the executable from the project directory:
./tailwindcss -i input.css -o output.css
  1. Check output.css.

Expected result: class names found inside the executable itself should not be included in the generated CSS. Actual result: Tailwind CSS detects the executable as a source file and includes class names found inside it in output.css.

Describe your issue

Tailwind CSS executables should not discover themselves as source files, and should not include class names written inside the executable itself.

If an executable is stored inside the project, Tailwind CSS currently detects the executable by default. This can be worked around with @source not or .gitignore, but I do not think the expected default behavior is that every class name written inside the executable should be included in my project's output.css.

By default, the executable should not treat itself as part of the project's source files.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions