-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bundle core plugins with the standalone build (#15028)
Closes #15012 We do not have replacements for these plugins _just yet_. In order to increase compatibility with setups that rely on some of these legacy plugins, this PR bundles `@tailwindcss/forms`, `@tailwindcss/typography`, and `@tailwindcss/aspect-ratio` (after #15029) with the standalone build now. In comparison to v3, this omits the `@tailwindcss/container-queries` plugin since is not a first-party feature of Tailwind CSS v4. ## Test Plan Added an integration test. I also tested this by running the standalone binary in a temporary folder with as simple input css: ```css @import "tailwindcss"; @plugin "@tailwindcss/typography"; ```
- Loading branch information
1 parent
b73c746
commit e4bfa8c
Showing
7 changed files
with
162 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import os from 'node:os' | ||
import path from 'node:path' | ||
import { candidate, css, html, json, test } from '../utils' | ||
|
||
const STANDALONE_BINARY = (() => { | ||
switch (os.platform()) { | ||
case 'win32': | ||
return 'tailwindcss-windows-x64.exe' | ||
case 'darwin': | ||
return os.arch() === 'x64' ? 'tailwindcss-macos-x64' : 'tailwindcss-macos-arm64' | ||
case 'linux': | ||
return os.arch() === 'x64' ? 'tailwindcss-linux-x64' : 'tailwindcss-linux-arm64' | ||
default: | ||
throw new Error(`Unsupported platform: ${os.platform()} ${os.arch()}`) | ||
} | ||
})() | ||
|
||
test( | ||
'includes first-party plugins', | ||
{ | ||
fs: { | ||
'package.json': json` | ||
{ | ||
"dependencies": { | ||
"tailwindcss": "workspace:^", | ||
"@tailwindcss/cli": "workspace:^" | ||
} | ||
} | ||
`, | ||
'index.html': html` | ||
<div className="prose"> | ||
<h1>Headline</h1> | ||
</div> | ||
<input type="text" class="form-input" /> | ||
<div class="aspect-w-16"></div> | ||
`, | ||
'src/index.css': css` | ||
@import 'tailwindcss/theme' theme(reference); | ||
@import 'tailwindcss/utilities'; | ||
@plugin '@tailwindcss/forms'; | ||
@plugin '@tailwindcss/typography'; | ||
@plugin '@tailwindcss/aspect-ratio'; | ||
`, | ||
}, | ||
}, | ||
async ({ fs, exec }) => { | ||
await exec( | ||
`${path.resolve(__dirname, `../../packages/@tailwindcss-standalone/dist/${STANDALONE_BINARY}`)} --input src/index.css --output dist/out.css`, | ||
) | ||
|
||
await fs.expectFileToContain('dist/out.css', [ | ||
candidate`form-input`, | ||
candidate`prose`, | ||
candidate`aspect-w-16`, | ||
]) | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.