-
Notifications
You must be signed in to change notification settings - Fork 0
Comparing changes
Open a pull request
base repository: buyuan-dev/tailwindcss
base: main
head repository: tailwindlabs/tailwindcss
compare: main
- 6 commits
- 40 files changed
- 3 contributors
Commits on Mar 18, 2026
-
Bump Lightning CSS (tailwindlabs#19771)
This PR bumps Lightning CSS. The `node/index.js` file in the package changed, so we had to update the patched version of it as well. We also had to update the patches for `@parcel/watcher` and `lightningcss` now that they ship with `detect-libc@2`. Unfortunately, we still require the patches because we also need to take the `process.env.PLATFORM_LIBC` into account. Another issue is that bun needs to be able to statically analyze the `require(…)` calls, so using the nice `parts.push` approach doesn't really work here. # Test plan 1. Existing tests should pass 2. Updated some tests to reflect the changes in the generated CSS based on the version bump. [ci-all]
Configuration menu - View commit details
-
Copy full SHA for 2228a57 - Browse repository at this point
Copy the full SHA 2228a57View commit details -
Configuration menu - View commit details
-
Copy full SHA for d596b0c - Browse repository at this point
Copy the full SHA d596b0cView commit details
Commits on Mar 19, 2026
-
Add canonicalizations for
tracking-*utilities (tailwindlabs#19827)This PR adds support for canonicalizations for `tracking-*` utilities. This one is a bit of a funny one, if you take a look at the linked issue, there is a beautiful table: | Utility Name | Value | Arbitrary Value | Throws Suggestion | | - | -: | - | - | | tracking-tighter | -0.05em | tracking-[-0.05em] | ✗ | | tracking-tight | -0.025em | tracking-[-0.025em] | ✗ | | tracking-normal | 0em | tracking-[0em] | ✗ | | tracking-wide | 0.025em | tracking-[0.025em] | ✗ | | tracking-wider | 0.05em | tracking-[0.05em] | ✗ | | tracking-widest | 0.1em | tracking-[0.1em] | ✓ | It doesn't really make sense to _why_ only the `tracking-widest` one is properly suggested here. Until you look a little bit closer. Turns out that `-tracking-tighter` is equivalent to `tracking-wider`, `-tracking-tight` is equivalent to `tracking-wide` and so on. The way the canonicalization works internally is by generating a signature for a given utility class. If two utilities have the exact same signature, we can consider them the same. In this case `tracking-widest` and `tracking-[0.1em]` have the same signature. One of the rules we have internally is that if we find more than one replacement utility then we don't really know what to do, so we bail. Because if you get `foo` or `bar`, which one do you pick? If we refer to this above table again, the moment we want to canonicalize the `tracking-[-0.05em]` we get two suggestions: `tracking-tighter` and `-tracking-wider`, since we don't know what to do, we bail and we don't suggest anything. So the reason that `tracking-widest` _was_ suggested is just because we don't have a `-tracking-tightest`. How do we fix this? Well, since we have `tracking-*` and `-tracking-*` utilities, I wanted to deprecate the `-tracking-*` ones for named utilities (where the values come from your theme) because that doesn't really make sense. However, we have this exact pattern documented here: https://tailwindcss.com/docs/letter-spacing#using-negative-values Which means that I can't just deprecate those utilities. <img width="723" height="511" alt="image" src="https://github.com/user-attachments/assets/164b659b-abe9-4f6e-a176-701dd7ea505a" /> Instead, I added a different rule which says that if you get multiple possible replacements, then we prefer the "positive" one, the one without the `-`. Also added some additional checks to make sure that if you get `foo`, `-bar`, `baz`, that we also bail because we know that we should prefer `foo` or `baz` over `-bar`, but we don't know if we should pick `foo` or `baz`... This additional rule does solve the original issue, and we already prefer possible values over negative values in other places (related to bare values). Fixes: tailwindlabs/tailwindcss-intellisense#1558 ## Test plan 1. Existing tests pass 2. Added regression tests to make sure that the table from above _does_ get canonicalized correctly into the expected values.
Configuration menu - View commit details
-
Copy full SHA for 7482d47 - Browse repository at this point
Copy the full SHA 7482d47View commit details
Commits on Mar 20, 2026
-
Fix crash due to invalid characters in candidate (tailwindlabs#19829)
This PR fixes an issue where the compiler can crash if it encounters an invalid codepoint. When we extract potential candidates from files, it could be that we encounter values that look like a class or a CSS variable, if it turns out that it's an invalid CSS variable we can ignore it. The problem is that sometimes there are escaped values in there that result in invalid code points crashing the compiler. This PR fixes that by gracefully handling that and making sure that invalid code points are replaced by `\uFFFD` as per the spec. The bug report (tailwindlabs#19786) has a clean example where a piece of text looks like a CSS variable, but contains invalid code points. ``` --Coding-Projects-CharacterMapper-Master-Workspace\d8819554-4725-4235-9d22-2d0ed572e924 ``` Luckily we can fix this today by ignoring the file paths that contain these strings using `@source not "…";`, but the better way is to actually fix this. To solve this, instead of blindly passing numbers to `String.fromCodePoint`, we will first validate whether it's a valid codepoint: 1. `0x0000` — `0x10FFFF` (inclusive) is the range of valid code points. See: https://infra.spec.whatwg.org/#code-point 2. `0xD800` — `0xDBFF` (inclusive) are leading surrogates. See: https://infra.spec.whatwg.org/#leading-surrogate 3. `0xDC00` — `0xDFFF` (inclusive) are trailing surrogates. See: https://infra.spec.whatwg.org/#trailing-surrogate In the code we use the `0xD800` — `0xDFFF` range because the ranges overlap. There are various references in the spec to replace surrogates (and invalid codepoints) with `\uFFFD`. Here is one of them: https://drafts.csswg.org/css-syntax-3/#consume-escaped-code-point Fixes: tailwindlabs#19786 Fixes: tailwindlabs#19801 (this issue talks about a similar invalid code point issue) ## Test plan 1. Added a regression test where the above string was used as a CSS variable 2. Added a regression test for the unescape functionality to make sure that invalid code points and surrogates are replaced by the `\uFFFD` replacement character. [ci-all] Just to verify on Windows as well
Configuration menu - View commit details
-
Copy full SHA for bd30a71 - Browse repository at this point
Copy the full SHA bd30a71View commit details -
fix(vite): resolve tsconfig paths in CSS and JS resolvers (tailwindla…
…bs#19803) Change `aliasOnly` from `true` to `false` when calling Vite's resolver so that the full resolution pipeline runs, including the oxc resolver responsible for tsconfig path resolution. When `aliasOnly` was `true`, only the @rollup/plugin-alias plugin ran, which meant `resolve.tsconfigPaths: true` had no effect on CSS `@import` or JS `@plugin` resolution in `@tailwindcss/vite`. Closes tailwindlabs#19802. --------- Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 5cb1efd - Browse repository at this point
Copy the full SHA 5cb1efdView commit details -
Fix webpack loader cache key for resource queries (tailwindlabs#19723)
<!-- 👋 Hey, thanks for your interest in contributing to Tailwind! **Please ask first before starting work on any significant new features.** It's never a fun experience to have your pull request declined after investing a lot of time and effort into a new feature. To avoid this from happening, we request that contributors create a discussion to first discuss any significant new features. For more info, check out the contributing guide: https://github.com/tailwindlabs/tailwindcss/blob/main/.github/CONTRIBUTING.md --> ## Summary <!-- Provide a summary of the issue and the changes you're making. How does your change solve the problem? --> `@tailwindcss/webpack` currently uses `this.resourcePath` as the cache key, which ignores the resource query. When the same CSS file is imported multiple times with different `resourceQuery` values, all of those imports share a single `CacheEntry`. That means the utilities discovered for one entry can leak into the CSS output for another entry. This PR changes the cache key to use `this.resource` (path + query) instead, while still using `this.resourcePath` for all filesystem work. ## Test plan <!-- Explain how you tested your changes. Include the exact commands that you used to verify the change works and include screenshots/screen recordings of the update behavior in the browser if applicable. --> - `pnpm test:integrations -- webpack/loader.test.ts` - Confirms all existing webpack loader integration tests pass. - Confirms the new `@tailwindcss/webpack loader isolates cache by resource including query` test passes, verifying that two entries importing the same CSS file with different queries produce isolated outputs (`dist/a.css` only contains `only-a` / `--color-red-500`, and `dist/b.css` only contains `only-b` / `--color-blue-500`). --------- Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 17d324f - Browse repository at this point
Copy the full SHA 17d324fView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff main...main