No description
Find a file
Robin Malfait 6d9d3b65e4
rewrite source scanning around one walker per source kind
Previously all `@source` directives were compiled into a single file walker:
directives became layered gitignore rules, `expand_restricted_patterns`
injected `*` / `/*` / `!/dir/` counter-rules to restrict concrete patterns,
and a global `filter_entry` re-checked files against every source. Because
all rules were global to the one walker, sources contaminated each other:
pattern-driven re-includes leaked into auto source results, and auto source
bases legitimized files that only a pattern's walk root reached. This caused
a family of bugs:

- #18870: globs through directories that are ignored from within (Laravel's
  `storage/` layout) found nothing
- a concrete file `@source` pointing behind `node_modules` or a git ignored
  directory scanned all of its siblings
- `@source "./foo/*.html"` on an ignored folder also scanned other
  extensions in `foo`
- external sources (explicitly listed ignored directories) scanned nested
  `node_modules`

Sources are now split over multiple walkers:

- One gitignore-aware walker for all auto/external roots. Default rules and
  `@source not` rules are registered as explicit in-memory gitignores in
  directive order (later directives win); external roots get a `!/**/*`
  whitelist plus a re-statement of the default rules so that e.g. nested
  `node_modules` stay ignored.

- One walker per pattern base. The static prefix of a glob is the explicit
  part: it is used as the walk root and `.gitignore` files above it never
  apply, even when the base is hidden inside an ignored directory. The
  wildcard part is not explicit: `.gitignore` files inside the subtree and
  the default-ignored directories still prune (`@source "./**/*.html"` does
  not descend into `node_modules` or a git ignored `dist/";
  `@source "./dist/**/*.html"` does). Matching files always win over
  file-level ignores, and globs that don't pin an extension re-apply the
  default extension rules. A filter closure makes the exact per-file
  decision, honoring the relative order of `@source not` directives, and
  `dir_could_contain_matches` keeps the walk pruned to directories that can
  actually contribute files.

The `@source` semantics are now documented as a spec at the top of
`scanner/mod.rs` and pinned by eleven new tests (six of which failed on the
old implementation). Four unit tests asserting the internals of the removed
`expand_restricted_patterns` mechanism were deleted; the user-visible
behavior they guarded is covered by the scanner-level tests.
2026-08-13 11:35:40 +02:00
.github Bump dependencies (#20381) 2026-08-04 13:55:03 +02:00
crates rewrite source scanning around one walker per source kind 2026-08-13 11:35:40 +02:00
integrations Don't scan ignored folders using .gitignore safelist setup (#20397) 2026-08-07 17:44:33 +02:00
packages test: fix 'with with' typo in css parser tests (#20410) 2026-08-13 11:05:30 +02:00
patches Use wasm as a fallback for @tailwindcss/oxide (#20383) 2026-08-04 18:41:43 +02:00
playgrounds migrate to pnpm v11 (#20273) 2026-06-25 19:14:10 +02:00
scripts migrate to pnpm v11 (#20273) 2026-06-25 19:14:10 +02:00
.gitignore Fix slow unit test (#17465) 2025-03-31 15:26:01 +02:00
.prettierignore Bump dependencies (#19608) 2026-02-04 12:38:50 +01:00
Cargo.lock visualize scanned files 2026-08-13 11:34:18 +02:00
Cargo.toml Hoist oxide/crates to just crates (#13333) 2024-03-23 09:00:48 -04:00
CHANGELOG.md Fix slow Vite rebuilds in projects with large gitignored directories (#20408) 2026-08-12 14:31:47 +00:00
LICENSE Add README, LICENSE, and CONTRIBUTING (#13088) 2024-03-05 14:45:39 -05:00
package.json Bump dependencies (#20381) 2026-08-04 13:55:03 +02:00
pnpm-lock.yaml Use wasm as a fallback for @tailwindcss/oxide (#20383) 2026-08-04 18:41:43 +02:00
pnpm-workspace.yaml Use wasm as a fallback for @tailwindcss/oxide (#20383) 2026-08-04 18:41:43 +02:00
README.md docs: fix GitHub links to tailwindlabs org (#19686) 2026-02-17 13:06:49 +01:00
rust-toolchain.toml Bump NAPI related dependencies (#19982) 2026-04-26 17:49:06 +02:00
turbo.json Bump dependencies (#20381) 2026-08-04 13:55:03 +02:00
vitest.config.mts Bump dependencies (#20381) 2026-08-04 13:55:03 +02:00

Tailwind CSS

A utility-first CSS framework for rapidly building custom user interfaces.

Build Status Total Downloads Latest Release License


Documentation

For full documentation, visit tailwindcss.com.

Community

For help, discussion about best practices, or feature ideas:

Discuss Tailwind CSS on GitHub

Contributing

If you're interested in contributing to Tailwind CSS, please read our contributing docs before submitting a pull request.