magento / magento/magento-cloud

Allow-list .gitignore breaks Tailwind CSS v4 @source scanning for vendor/

Open Beginner friendly
#547 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
226
Forks
244
PR merge metrics
No merged PRs in 30d

Description

The `.gitignore` in this repository uses an allow-list pattern (starting with `*`, followed by `!` exceptions). This conflicts with how Tailwind CSS v4 resolves `@source` directives.

Tailwind v4 uses git to determine which files are eligible for scanning. When the `.gitignore` starts with `*`, the entire `vendor/` directory is invisible to git. As a result, any `@source` path pointing into `vendor/` is silently ignored, even when explicitly declared. No warning or error is emitted.

This breaks Hyvä themes, which use `@source` to scan the default theme in `vendor/hyva-themes/magento2-default-theme`:

```css
@import "tailwindcss" source(none);
@source "../../**/*.phtml";
@source "../../**/*.xml";
@source "../../../../../../vendor/hyva-themes/magento2-default-theme";
```

On a project using this repository's `.gitignore`, the last `@source` line produces no output. Styles from the default theme are silently missing from the build.

The standard [Magento 2 `.gitignore`](https://github.com/magento/magento2/blob/2.4-develop/.gitignore) uses a deny-list approach (`/vendor/*` explicitly listed) and does not trigger this issue.

A minimal reproduction is available at: https://github.com/GrimLink/tailwind-gitignore-bug

The underlying Tailwind behavior is tracked at: https://github.com/tailwindlabs/tailwindcss/issues/19844

**Proposed fix:** Align the `.gitignore` in this repository with the deny-list approach used in the Magento 2 core repository, explicitly listing ignored directories rather than denying everything by default.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the repository's .gitignore and compare its allow-list pattern with the Magento 2 deny-list version linked in the issue. Use the linked minimal reproduction or a Tailwind CSS v4 build with the shown @source path, and confirm that files under vendor/ are scanned and their styles are no longer silently omitted.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, php, tailwindcss
Domain
build-system, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.