Skip to content

Conversation

thecrypticace
Copy link
Contributor

@thecrypticace thecrypticace commented Jul 23, 2025

Breaking change

tailwindcss is now resolved relative to each processed file

Loading the tailwindcss version relative to each processed file produces more correct behavior for monorepos where tailwindcss may not be installed at the project root but instead in a subdirectory. Because of this projects with multiple Tailwind CSS versions in the same repo are also more likely to work than before.

Automatically loaded v3 configs are resolved relative to each processed file

Similar to the above, the same happens when we automatically locate your v3-style config files. Previously these were always searched for relative to the Prettier config — this often meant the file needed to be in the project root. This is no longer the case which should improve support for monorepos with multiple configs using Tailwind CSS v3.


This ended up turning into a complete rework of the module and config loading. There's definitely going to be some different perf characteristics because some things are loaded relative to an input file now but it's hopefully minimal.

Will need to do lots of perf testing on a large codebase — esp with lots of embedded languages/expressions (e.g. large Vue files).

  • Needs implementation tests
  • Needs manual performance testing

Closes #243 (since the implementation is now entirely different but does the same thing)
Fixes #340
Closes #361
Closes #363
Closes #369

@thecrypticace thecrypticace added this to the 0.7.0 milestone Jul 23, 2025
@thecrypticace thecrypticace force-pushed the feat/better-monorepo-support branch from 5253d6e to a14691d Compare August 1, 2025 02:04
@thecrypticace thecrypticace marked this pull request as ready for review August 13, 2025 17:02
@thecrypticace thecrypticace force-pushed the feat/better-monorepo-support branch from a14691d to e07af2e Compare August 20, 2025 20:34
Copy link
Member

@RobinMalfait RobinMalfait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, a few small questions/suggestions.

The src/config.ts file reads very nicely right now.

I think technically this change could be a breaking change, but for people with simple setups looking for tailwindcss from the config or input file shouldn't result in any differences. But for people with a more complex (monorepo) setup it should solve locating tailwindcss correctly.

Running into some issues with this PR, let's discuss this on Tuple later 👍

@thecrypticace thecrypticace force-pushed the feat/better-monorepo-support branch from f7fc236 to 827e5f2 Compare August 29, 2025 16:03
@thecrypticace thecrypticace merged commit fa61eae into main Aug 29, 2025
1 check passed
@thecrypticace thecrypticace deleted the feat/better-monorepo-support branch August 29, 2025 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants