Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Ensure `@tailwindcss/turbopack` and `@tailwindcss/webpack` rebuild when the input CSS changes (e.g. `next dev` with Turbopack no longer serves the CSS of the previous edit) ([#20582](https://github.com/tailwindlabs/tailwindcss/pull/20582))
- Canonicalization: don't ignore a `--tw-*` variable in a utility's signature when only an unrelated property has the same value (e.g. `--tw-translate-x: 16px` next to `margin-top: 16px`) ([#20593](https://github.com/tailwindlabs/tailwindcss/pull/20593))
- Decode single-digit hexadecimal escapes in theme variable and `@utility` names as the CSS spec does (e.g. `@theme { --color-\0: red; }` no longer registers `--color-0`) ([#20591](https://github.com/tailwindlabs/tailwindcss/pull/20591))
- Remove imports of unshipped modules from `@tailwindcss/node` type declarations ([#20632](https://github.com/tailwindlabs/tailwindcss/pull/20632))

## [4.3.3] - 2026-07-16

Expand Down
52 changes: 52 additions & 0 deletions integrations/node/types.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { json, test, ts } from '../utils'

// https://github.com/tailwindlabs/tailwindcss/issues/20631
test(
'type declarations only import modules that are shipped',
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved
{
fs: {
'package.json': json`
{
"type": "module",
"dependencies": {
"tailwindcss": "workspace:^",
"@tailwindcss/node": "workspace:^"
},
"devDependencies": {
"typescript": "^5.9.3"
}
}
`,
'tsconfig.json': json`
{
"compilerOptions": {
"target": "ESNext",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"strict": true,
"noEmit": true,
"skipLibCheck": false
},
"include": ["index.ts"]
}
`,
'index.ts': ts`
import { __unstable__loadDesignSystem, compile } from '@tailwindcss/node'

let compiler = await compile('@import "tailwindcss";', {
base: '.',
onDependency() {},
})
compiler.build(['flex'])

let designSystem = await __unstable__loadDesignSystem('@import "tailwindcss";', {
base: '.',
})
designSystem.candidatesToCss(['flex'])
`,
},
},
async ({ exec }) => {
await exec('pnpm tsc')
},
)
5 changes: 4 additions & 1 deletion packages/@tailwindcss-node/src/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ export async function compile(css: string, options: CompileOptions) {
return compiler
}

export async function __unstable__loadDesignSystem(css: string, { base }: { base: string }) {
export async function __unstable__loadDesignSystem(
css: string,
{ base }: { base: string },
): ReturnType<typeof ___unstable__loadDesignSystem> {
return ___unstable__loadDesignSystem(css, {
base,
async loadModule(id, base) {
Expand Down