Fixes #20568. ## Summary The `@property` fallback is gated on `not (margin-trim: inline)`. The CSSWG removed the inline values (w3c/csswg-drafts#13731), and Safari Technology Preview now rejects them, so the fallback resets override utilities there. This switches to `margin-trim: block`. That value is still in the grammar and shipped with `@property` in [Safari 16.4](https://webkit.org/blog/13966/webkit-features-in-safari-16-4/), so the branch still matches only older Safari. Firefox's branch is unchanged. I did not use `at-rule(@property)`: browsers without `at-rule()` support would evaluate `not at-rule(…)` as true. ## Test plan - `pnpm vitest run packages/tailwindcss/src/index.test.ts -t 'fallback detection'`: fails on `main`, passes here. - `pnpm vitest run packages/tailwindcss`: 5107 passed, 1 skipped; snapshots updated for the new string. - Not run locally: the `@tailwindcss/postcss` tests and the integration tests (no oxide native build here). Prepared with AI assistance (Claude), reviewed and tested before submission. --------- Co-authored-by: Robin Malfait <robin.malfait@shopify.com>
A utility-first CSS framework for rapidly building custom user interfaces.
Documentation
For full documentation, visit tailwindcss.com.
Community
For help, discussion about best practices, or feature ideas:
Discuss Tailwind CSS on GitHub
Contributing
If you're interested in contributing to Tailwind CSS, please read our contributing docs before submitting a pull request.
@tailwindcss/postcss plugin API
Changing where the plugin searches for source files
You can use the base option (defaults to the current working directory) to change the directory in which the plugin searches for source files:
import tailwindcss from '@tailwindcss/postcss'
export default {
plugins: [
tailwindcss({
base: path.resolve(__dirname, './path'),
}),
],
}
Enabling or disabling Lightning CSS
By default, this plugin detects whether or not the CSS is being built for production by checking the NODE_ENV environment variable. When building for production Lightning CSS will be enabled otherwise it is disabled.
If you want to always enable or disable Lightning CSS the optimize option may be used:
import tailwindcss from '@tailwindcss/postcss'
export default {
plugins: [
tailwindcss({
// Enable or disable Lightning CSS
optimize: false,
}),
],
}
It's also possible to keep Lightning CSS enabled but disable minification:
import tailwindcss from '@tailwindcss/postcss'
export default {
plugins: [
tailwindcss({
optimize: { minify: false },
}),
],
}
Enabling or disabling url(…) rewriting
Our PostCSS plugin can rewrite url(…)s for you since it also handles @import (no postcss-import is needed). This feature is enabled by default.
In some situations the bundler or framework you're using may provide this feature itself. In this case you can set transformAssetUrls to false to disable this feature:
import tailwindcss from '@tailwindcss/postcss'
export default {
plugins: [
tailwindcss({
// Disable `url(…)` rewriting
transformAssetUrls: false,
// Enable `url(…)` rewriting (the default)
transformAssetUrls: true,
}),
],
}