190 Commits

Author SHA1 Message Date
Robin Malfait
ae130776ab
Revert "pin musl-related docker images"
This reverts commit 26515af2d55f1f56f3daaad13e6d1e01403c2c6e.
2026-01-06 15:11:38 +01:00
Robin Malfait
26515af2d5
pin musl-related docker images 2026-01-06 15:07:42 +01:00
Robin Malfait
7d78fda879
temporarily disable discord notifications 2026-01-06 14:37:46 +01:00
Robin Malfait
6313cf6770
bump to Node 24 in CI
All bumped `actions/*` for GitHub Workflows require Node 24 right now.
We were relying on Node 20, but that's in maintenance mode until April.

Node 24 is the current Active LTS version.
2026-01-06 13:48:17 +01:00
Robin Malfait
bde403e013
bump actions/github-script to v8 2026-01-06 13:46:44 +01:00
Robin Malfait
562acdac54
bump actions/cache to v5 2026-01-06 13:45:57 +01:00
Robin Malfait
d214c30161
bump actions/download-artifact to v6 2026-01-06 13:44:23 +01:00
Robin Malfait
bd7fe7abc8
bump actions/upload-artifact to v6 2026-01-06 13:43:59 +01:00
Robin Malfait
4f76b47f40
bump actions/checkout to v6 2026-01-06 13:41:55 +01:00
Robin Malfait
7107c04713
bump actions/setup-node to v6 2026-01-06 13:39:44 +01:00
Robin Malfait
4719dd9848
Revert "run release workflows against newer Node version"
This reverts commit 1f9ac73daf07112a8efe43e140861fffe4468a99.
2026-01-06 13:37:35 +01:00
Robin Malfait
1f9ac73daf
run release workflows against newer Node version
When using NAPI to build for release purposes, it relies on `inquirer`,
which relies on `@inquirer/core` which relies on a modern Node version
to support `import { styleText } from 'node:util'`

We want to still make sure that CI / Integration Tests pass on Node v20
(which we currently do), so just bumping the prepare-release.yml,
release-insiders.yml and release.yml workflows.

If this isn't enough, I'll properly drop the `@napi-rs/cli` version or
force an `inquirer`/`@inquirer/core` version. Let's try this first.
2026-01-06 13:25:14 +01:00
Robin Malfait
479b725cd3
Bump Vitest to v4 (#19216)
This PR bumps Vitest from v2 to v4. As far as I know we don't use any
Vitest specific features in our tests, but had to upgrade the
`vitest.workspace.ts` file to a `vitest.config.ts` file instead.

The only features we use are the typical `describe`, `it`, `test`, and
`expect` functions.

The only other part we use is `vi.spyOn` and `vi.fn` but those didn't
change in API either.

The test shards were removed to prevent errors. Not all suites have
enough files / tests to be broken up into 3 parts so Vitest now errors
when that happens.

### Test plan

1. All tests should pass in CI.
2. All integration tests should pass in CI.

---------

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2025-11-20 18:16:20 -05:00
Philipp Spiess
afe3de3bd6
Revert agentic issue-triage workflow (#19155)
Reverts #19057

Unfortunately wasn't able to get this to work since the permissions will
always cause it to not be triggered when someone outside our GitHub orgs
contributes.
2025-10-20 12:20:08 +02:00
Robin Malfait
86e4b8e636
run prettier 2025-10-06 17:15:57 +02:00
Philipp Spiess
231e17b84a Change permissions so issue-triage can run for everyone 2025-10-06 16:20:09 +02:00
Philipp Spiess
4cbdfa6e43 Issue triage tweaks 2025-10-06 12:37:20 +02:00
Philipp Spiess
9ef314e786
Add agentic workflow issue-triage (#19057)
This PR attempts to set up an automatic issue triaging tool using Claude
Code as the agent and GitHub Agentics as the framework:
https://githubnext.github.io/gh-aw/start-here/quick-start/

Based on the `safe-outputs` setting, this agent can only label issues or
write replies. Let's see how useful that is 🤷

You can't run it locally since it does not have a manual trigger and
needs a new github issue instead so my plan is to merge it and then
create some super legit issues to see if it works!

## Test plan

```
α dev/tailwindcss (add-workflow-workflows-issue-triage.md-3051) gh aw status
Workflow Status
Name         | Installed | Up-to-date | Status  | Time Remaining
------------ | --------- | ---------- | ------- | --------------
issue-triage | Yes       | Yes        | Unknown | 29d 22h
```

---------

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2025-10-06 12:24:51 +02:00
Robin Malfait
9d00662e10
Show version mismatch when running upgrade tool (#19028)
This PR fixes an issue where sometimes people try to run the upgrade
tool, reset the changes and then try again.

If this happens, then the `package.json` and/or your lock file will
point to the old Tailwind CSS v3 version, but the actual installed
version will be v4.

This will also cause the upgrade tool to now upgrade from v4 to v4,
which is not what most people want if they were trying to upgrade from
v3 to v4. This in turn will cause some issues because now we won't try
to migrate the config file, or v3-specific classes that also exist in v4
but are only safe to upgrade from v3 to v4.

This PR uses `npm ls tailwindcss` to determine the actual installed
version. This command already errors if there is a mismatch between the
installed version and the version in `package.json` or the lock file.
This also happens to work in pnpm and bun projects (added integration
tests for these).

If for whatever reason we can't determine the expected version, we fall
back to the old behavior of just upgrading. In this scenario, the
changes introduced in
https://github.com/tailwindlabs/tailwindcss/pull/19026 will at least
give you a hint of what version was actually installed.

### Test plan

1. Tested it in a v3 project where I performed the following steps:
   1. Run the upgrade tool in full (`npx tailwindcss-upgrade`)
   2. Reset the changes (`git reset --hard && git clean -df`)
   1. Run the upgrade tool again

This resulted in the following output: <img width="1059" height="683"
alt="image"
src="https://github.com/user-attachments/assets/1d2ea2d1-b602-4631-958f-cc21eb8a633f"
/>


2. Added some integration tests to make sure this also works in pnpm,
bun and normal npm projects.

[ci-all]
2025-09-29 16:21:44 +02:00
depfu[bot]
d6464bda09
Update @types/bun 1.2.20 → 1.2.22 (patch) (#19002)
Here is everything you need to know about this update. Please take a
good look at what changed and the test results before merging this pull
request.

### What changed?




#### ✳️ @​types/bun (1.2.20 → 1.2.22) ·
[Repo](https://github.com/DefinitelyTyped/DefinitelyTyped)





Sorry, we couldn't find anything useful about this release.











---
![Depfu
Status](https://depfu.com/badges/edd6acd35d74c8d41cbb540c30442adf/stats.svg)

[Depfu](https://depfu.com) will automatically keep this PR
conflict-free, as long as you don't add any commits to this branch
yourself. You can also trigger a rebase manually by commenting with
`@depfu rebase`.

<details><summary>All Depfu comment commands</summary>
<blockquote><dl>
<dt>@​depfu rebase</dt><dd>Rebases against your default branch and
redoes this update</dd>
<dt>@​depfu recreate</dt><dd>Recreates this PR, overwriting any edits
that you've made to it</dd>
<dt>@​depfu merge</dt><dd>Merges this PR once your tests are passing and
conflicts are resolved</dd>
<dt>@​depfu cancel merge</dt><dd>Cancels automatic merging of this
PR</dd>
<dt>@​depfu close</dt><dd>Closes this PR and deletes the branch</dd>
<dt>@​depfu reopen</dt><dd>Restores the branch and reopens this PR (if
it's closed)</dd>
<dt>@​depfu pause</dt><dd>Ignores all future updates for this dependency
and closes this PR</dd>
<dt>@​depfu pause [minor|major]</dt><dd>Ignores all future minor/major
updates for this dependency and closes this PR</dd>
<dt>@​depfu resume</dt><dd>Future versions of this dependency will
create PRs again (leaves this PR as is)</dd>
</dl></blockquote>
</details>

---------

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2025-09-26 15:42:15 +00:00
Jonathan Reinink
3cab801761
Create FUNDING.yml 2025-07-02 13:22:16 -04:00
Robin Malfait
f0f42f62c0
Use shards when running integration tests (#18246)
This PR splits CI integration tests in 3 shards to reduce the time it
takes to run them to hopefully prevent timeouts on a single step.
2025-06-06 19:43:17 +00:00
Philipp Spiess
ae57d26852
Update contribution docs (#17911)
This PR updates the contribution docs to make it easier for anyone
contributing to Tailwind CSS.
2025-05-09 12:14:32 +02:00
Robin Malfait
62706dccb0
Trigger updates to the internal upgrades repo (#17928)
This PR updates will now trigger the new internal `upgrades` repo
instead of the Tailwind Play repo directly.

We will be updating more internal repos when a new version is published.
We will also use that new repo to update our other repos for other
published packages in the future.
2025-05-08 18:46:27 +02:00
Philipp Spiess
25539e3533 Fix release script 2025-04-14 19:06:18 +02:00
Philipp Spiess
d801d8dc54
Fix publish step on CI (#17654)
To publish the newly adde WASM builds, we rely on the
`node-linker=hoisted` `.npmrc` flag that isn't read when `pnpm
--recursive` is used. To work around it, this PR excludes the wasm
package from the `--recursive` part and manually published it
afterwards.


## Test Plan

Ensured this does not error now when trying a `--dry run`.

<img width="1273" alt="Screenshot 2025-04-11 at 17 43 38"
src="https://github.com/user-attachments/assets/68a28552-0125-4da1-92ff-74e58368abe4"
/>
2025-04-11 18:14:48 +02:00
Philipp Spiess
83ce4c0a30
Add experimental @tailwindcss/oxide-wasm32-wasi (#17558)
Closes #17448
Closes #13133

This PR adds an a new Oxide target for `wasm32-wasip1-threads`:
`@tailwindcss/oxide-wasm32-wasi`. The goal of this is to enable more
environments to run Oxide, including (but not limited to) StackBlitz.

We're making use of `napi-rs`'s upcoming v3 features to simplify the
setup here, meaning `napi-rs` will configure the WASM target and create
an npm package that works across Node and browser environments.

## MacOS AArch64 issues

While setting up an integration test for the new WASM target, I ran into
an issue where FS reads where not terminating on macOS. After some
research I found this to be a limitation of the Node.js container
interface right now, see: https://github.com/nodejs/node/issues/47193

### Windows issues

We also found that the Node.js wasi container does not properly support
Windows: https://github.com/nodejs/uvwasi/issues/11

For now we, it's probably best for MacOS AArch64 users and Windows users
to use the native modules instead.

## Test plan

The `@tailwindcss/oxide-wasm32-wasi` npm package can be built locally
via `pnpm build` and then run with the Oxide API. A usage example can be
taken from the newly added integration test.

Furthermore this was tested to work as a polyfill on StackBlitz:
https://stackblitz.com/edit/vitejs-vite-uks3gt5p

[ci-all]

---------

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2025-04-11 17:19:55 +02:00
Robin Malfait
53801091a0
Watch CSS module files for changes (#17467)
This PR is a follow-up PR for:
https://github.com/tailwindlabs/tailwindcss/pull/17433

In the other PR we allow scanning CSS files for extracting usages of CSS
variables. This is important for `.module.css` files that reference
these variables but aren't in the same big AST of the main CSS file.

This PR also makes sure to watch for changes in those registered CSS
files and re-extract the variables when they change.

This PR took a bit longer than expected because I was trying to make
sure that writing to `./dist/out.css` works without infinite-looping
(e.g.: we had issues with this in Tailwind CSS v3 with webpack).

But I couldn't reproduce the issue at all. I did had some code that
tried to detect if the CSS file contained license headers and skip in
(because then it's very likely an output CSS file) but even without it
the tests were fine.

I setup integration tests with `@tailwindcss/cli` itself, and with tools
that use webpack. Added a test for Next.js, and a dedicated webpack test
as well.

Even without tests, locally, I couldn't reproduce an infinite loop due
to changes in an output CSS file...

Eventually dropped the code that tries to detect output CSS files.

One thing to keep in mind is that if you change any of your "main" CSS
files, then we will trigger a full rebuild anyway, so this change is
only required for unrelated CSS files (like CSS module files) that use
CSS variables.

## Test plan

1. Added integration tests for the CLI and Next.js
2. Added new dedicated test for webpack
2025-03-31 18:44:06 +02:00
Robin Malfait
1ef97759e3
Add @source not support (#17255)
This PR adds a new source detection feature: `@source not "…"`. It can
be used to exclude files specifically from your source configuration
without having to think about creating a rule that matches all but the
requested file:

```css
@import "tailwindcss";
@source not "../src/my-tailwind-js-plugin.js";
```

While working on this feature, we noticed that there are multiple places
with different heuristics we used to scan the file system. These are:

- Auto source detection (so the default configuration or an `@source
"./my-dir"`)
- Custom sources ( e.g. `@source "./**/*.bin"` — these contain file
extensions)
- The code to detect updates on the file system

Because of the different heuristics, we were able to construct failing
cases (e.g. when you create a new file into `my-dir` that would be
thrown out by auto-source detection, it'd would actually be scanned). We
were also leaving a lot of performance on the table as the file system
is traversed multiple times for certain problems.

To resolve these issues, we're now unifying all of these systems into
one `ignore` crate walker setup. We also implemented features like
auto-source-detection and the `not` flag as additional _gitignore_ rules
only, avoid the need for a lot of custom code needed to make decisions.

High level, this is what happens after the now:

- We collect all non-negative `@source` rules into a list of _roots_
(that is the source directory for this rule) and optional _globs_ (that
is the actual rules for files in this file). For custom sources (i.e
with a custom `glob`), we add an allowlist rule to the gitignore setup,
so that we can be sure these files are always included.
- For every negative `@source` rule, we create respective ignore rules.
- Furthermore we have a custom filter that ensures files are only read
if they have been changed since the last time they were read.

So, consider the following setup:

```css
/* packages/web/src/index.css */
@import "tailwindcss";
@source "../../lib/ui/**/*.bin";
@source not "../../lib/ui/expensive.bin";
```

This creates a git ignore file that (simplified) looks like this:

```gitignore
# Auto-source rules
*.{exe,node,bin,…}
*.{css,scss,sass,…}
{node_modules,git}/

# Custom sources can overwrite auto-source rules
!lib/ui/**/*.bin

# Negative rules
lib/ui/expensive.bin
```

We then use this information _on top of your existing `.gitignore`
setup_ to resolve files (i.e so if your `.gitignore` contains rules e.g.
`dist/` this line is going to be added _before_ any of the rules lined
out in the example above. This allows negative rules to allow-list your
`.gitignore` rules.

To implement this, we're rely on the `ignore` crate but we had to make
various changes, very specific, to it so we decided to fork the crate.
All changes are prefixed with a `// CHANGED:` block but here are the
most-important ones:

- We added a way to add custom ignore rules that _extend_ (rather than
overwrite) your existing `.gitignore` rules
- We updated the order in which files are resolved and made it so that
more-specific files can allow-list more generic ignore rules.
- We resolved various issues related to adding more than one base path
to the traversal and ensured it works consistent for Linux, macOS, and
Windows.

## Behavioral changes

1. Any custom glob defined via `@source` now wins over your `.gitignore`
file and the auto-content rules.
   - Resolves #16920
3. The `node_modules` and `.git` folders as well as the `.gitignore`
file are now ignored by default (but can be overridden by an explicit
`@source` rule).
   - Resolves #17318
   - Resolves #15882
4. Source paths into ignored-by-default folders (like `node_modules`)
now also win over your `.gitignore` configuration and auto-content
rules.
    -  Resolves #16669
5. Introduced `@source not "…"` to negate any previous rules.
   - Resolves #17058
6. Negative `content` rules in your legacy JavaScript configuration
(e.g. `content: ['!./src']`) now work with v4.
   - Resolves #15943 
7. The order of `@source` definitions matter now, because you can
technically include or negate previous rules. This is similar to your
`.gitingore` file.
9. Rebuilds in watch mode now take the `@source` configuration into
account
   - Resolves #15684

## Combining with other features

Note that the `not` flag is also already compatible with [`@source
inline(…)`](https://github.com/tailwindlabs/tailwindcss/pull/17147)
added in an earlier commit:

```css
@import "tailwindcss";
@source not inline("container");
```

## Test plan

- We added a bunch of oxide unit tests to ensure that the right files
are scanned
- We updated the existing integration tests with new `@source not "…"`
specific examples and updated the existing tests to match the subtle
behavior changes
- We also added a new special tag `[ci-all]` that, when added to the
description of a PR, causes the PR to run unit and integration tests on
all operating systems.

[ci-all]

---------

Co-authored-by: Philipp Spiess <hello@philippspiess.com>
2025-03-25 15:54:41 +01:00
Jordan Pittman
498b06f2d9 Fix the other two workflows 2025-03-20 16:38:19 -04:00
Jordan Pittman
508746b996 Remove fetch-tags from release workflow
The current checkout action can encounter a bug where, if this workflow was triggered by a tag, this breaks
2025-03-20 15:55:21 -04:00
Devon Govett
cec7f0557b
Fix segmentation fault when loading @tailwindcss/oxide in a Worker thread (#17276)
When Tailwind is loaded in a Node Worker thread, it currently causes a
segmentation fault on Linux when the thread exits. This is due to a
longstanding issue in Rust that affects all native modules:
https://github.com/rust-lang/rust/issues/91979. I reported this years
ago but unfortunately it is still not fixed, and seems to have gotten
worse in Rust 1.83.0 and later. Looks like Tailwind recently updated
Rust versions and this issue started appearing when run in tools like
Parcel that use worker threads.

The workaround is to prevent the native module from ever being unloaded.
One way to do that is to always load the native module in the main
thread in addition to workers, but this is hard to enforce.
@Brooooooklyn found another method, which is to use a linker option for
this. I tested this on an Ubuntu system and verified it fixed the issue.
You can test with the following script.

```js
// test.js
const {Worker} = require('worker_threads');
new Worker('./worker.js');

// worker.js
require('@tailwindcss/oxide');
```

Without this change, a segmentation fault will occur.

---------

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2025-03-18 16:28:20 -04:00
Philipp Spiess
50cce50fa4 FreeBSD: rustup toolchain install 2025-03-05 12:48:24 +01:00
Philipp Spiess
9381de498f Don't use beta version for FreeBSD 2025-03-05 12:25:09 +01:00
Philipp Spiess
a8a2a43f6a Pin pnpm version in freebsd build 2025-02-25 18:20:14 +01:00
Philipp Spiess
6fffcfd377 Run pnpm install first in freebsd build 2025-02-25 17:50:27 +01:00
Philipp Spiess
a7d8371c71 Require build-freebsd too 2025-02-25 17:44:05 +01:00
Philipp Spiess
c504f78e52 Update issue template 2025-02-17 11:25:38 +01:00
Philipp Spiess
14b13378cb
Update issue templates 2025-02-17 11:24:18 +01:00
Philipp Spiess
fadf442436
Update config.yml 2025-02-17 11:16:00 +01:00
Philipp Spiess
9bbe2e3d08
Revert: Only expose used CSS variables (#16403)
This reverts #16211

We found some unexpected interactions with using `@apply` and CSS
variables in multi-root setups like CSS modules or Vue inline `<style>`
blocks that were broken due to that change. We plan to re-enable this
soon and include a proper fix for those scenarios.

## Test plan

- Updated snapshots
- Tested using the CLI in a new project:
<img width="1523" alt="Screenshot 2025-02-10 at 13 08 42"
src="https://github.com/user-attachments/assets/defe0858-adb3-4d61-9d2c-87166558fd68"
/>

---------

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2025-02-10 13:26:13 +01:00
Robin Malfait
81de67c5ff
Cleanup Tailwind Play workflow (#16310)
This PR cleans up the Tailwind Play update by removing unnecessary
inputs because Tailwind Play will take care of this.
2025-02-06 18:56:29 +00:00
Philipp Spiess
837e240b4d
Add Freebsd build target (#16277)
Closes #15731

This PR adds a FreeBSD build target to our CI workflows. It was tested
on CI:
https://github.com/tailwindlabs/tailwindcss/actions/runs/13159185517/job/36723613079

However, due to the build not emitting final npm packages, we don't have
a way to actually test the final package before we ship it to an
insiders release.

---------

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2025-02-05 15:48:05 +00:00
Robin Malfait
2d3c196591
Rename next to main (#15980)
This PR renames `next` to `main` in GitHub Action Workflows and the
CONTRIBUTING.md file.
2025-01-28 11:31:54 -05:00
Robin Malfait
28008f1571
remove unnecessary version step
My bad.
2025-01-28 16:34:01 +01:00
Robin Malfait
35bc28b16b
Ensure we set the version before running build (#15971)
This PR ensures we set the version before running the build. Otherwise
the embedded version number is incorrect.
2025-01-28 10:21:18 -05:00
Robin Malfait
515a9bdc5f
Setup v4 releases (#15961)
Now that Tailwind CSS v4 is released, we can setup a proper release
workflow again. This setup mimics the workflow of how we did it in v3,
but adjusted to make it work on the v4 codebase.

Whenever a PR is merged into the `next` branch, we will publish an
insiders release to npm using the following version number:
`0.0.0-insiders.<commit-hash>`. Note: insiders releases will not have a
GitHub release associated with them, therefore the `standalone-cli`
won't be available as an insiders release.

For the normal release procedure, the following steps are required:

1. Manually version the packages (e.g.: `pnpm run version-packages`)
2. Create a git tag for the version you want to release
3. Push the updated package.json files and the git tag to the repository

Next, a GitHub action will kick in once a `tag` is being pushed.

The GitHub action will run a build, and create a draft release on GitHub
that will contain:

1. The CHANGELOG.md contents for the last version
2. The `standalone-cli` artifacts attached to the drafted release

Once you are happy with the draft, you can publish the draft on GitHub.

This in turn will trigger another GitHub action that will publish the
packages to npm.

Whenever an insiders release or a normal release completes, we will also
trigger Tailwind Play, to update its dependencies to the latest version
of Tailwind CSS.

---

Note: some of the GitHub Action workflows still refer to the `next`
branch instead of the `main` branch. If we later today want to get a new
release out, we can merge `next` into `main` and update the workflows
accordingly.


---

This is hard to test, but I started from the existing release.yml file
and adjusted things accordingly. The biggest change is related to the
insiders version. If you look at this temporary
[commit](572dddfc33),
you can see that the publishing (dry-run) seems to work as expected:
<img width="1508" alt="image"
src="https://github.com/user-attachments/assets/c075e788-dcbc-4200-aa32-2b9a3c54d629"
/>
2025-01-28 12:51:34 +01:00
Jordan Pittman
a3aec17908
Add musl binaries to the Standalone CLI (#15567)
Closes #15031

This adds musl binaries for the Standalone CLI on Linux aarch64 (ARM
64-bit) and x86_64 (Intel/AMD 64-bit).
2025-01-09 09:24:33 -05:00
Robin Malfait
a39d03663e
use single quotes 2024-12-13 15:30:58 +01:00
Robin Malfait
4277857702
Use better names for CI workflow, similar to Integration Tests workflow (#15378)
This PR improves the CI workflow names such that they are a bit more
pretty.

E.g.:
```diff
- CI / tests (20, namespace-profile-default, true)
+ CI / Linux
```
2024-12-12 13:58:56 +01:00