What Is New in Tailwind CSS 1.4
| Category | Highlights |
|---|---|
| New Features | Color opacity utilities, Built-in PurgeCSS, Experimental IE 11 target mode |
How can I control the opacity of colors with Tailwind CSS 1.4?
Tailwind 1.4 introduces dedicated opacity utilities that let you adjust the alpha channel of background, text, border, divide, and placeholder colors.
These utilities follow the pattern bg-opacity-{value}, text-opacity-{value}, border-opacity-{value}, divide-opacity-{value}, and placeholder-opacity-{value}. They compose with any existing color class:
<div class="bg-red-500 bg-opacity-25">
</div>
Values are drawn from the opacity scale in your theme, but you can override each category independently via backgroundOpacity, textOpacity, borderOpacity, divideOpacity, and placeholderOpacity in the theme section.
How do I remove unused CSS without a separate tool in Tailwind 1.4?
Tailwind 1.4 ships a built-in PurgeCSS integration that scans your source files and strips unused classes at build time.
Configure the purge array in tailwind.config.js with glob patterns that match the files where you use Tailwind classes:
// tailwind.config.js
module.exports = {
purge: [
'./src/**/*.html',
'./src/**/*.vue',
'./src/**/*.jsx',
],
theme: {},
variants: {},
plugins: [],
}
When you run your build (e.g., via PostCSS), Tailwind will automatically generate a minimal stylesheet, reducing file size dramatically.
How can I make Tailwind 1.4 generate IE 11-compatible CSS?
Set the target option to ie11 in your tailwind.config.js to disable features that IE 11 cannot handle.
This experimental mode turns off utilities that rely on modern CSS features such as custom properties or newer selectors, giving you a safe baseline for legacy browsers:
// tailwind.config.js
module.exports = {
target: 'ie11',
theme: {},
variants: {},
plugins: [],
}
Watch out for plugins that assume full feature support; they may need adjustments or conditional loading when IE 11 mode is active.
Frequently Asked Questions
Does Tailwind 1.4 require a newer version of Node?
Tailwind 1.4 works with the same Node versions supported by Tailwind 1.x, so no upgrade is required.
Can I customize the values used by the new opacity utilities?
You can define custom scales under backgroundOpacity, textOpacity, borderOpacity, divideOpacity, and placeholderOpacity in the theme section.
Is the built-in purge feature compatible with frameworks like Vue and React?
Yes, just include the appropriate file globs such as ./src/**/*.vue or ./src/**/*.jsx in the purge array.
How does the experimental IE 11 mode affect my existing Tailwind plugins?
Plugins that rely on modern CSS features may be disabled or need to be rewritten to avoid using those features.
Will existing bg-red-500 classes still work after upgrading to 1.4?
All existing color utilities continue to work unchanged.
How do I disable the built-in purge for a specific file?
Add a comment like /* purgecss ignore */ at the top of the file you want to keep untouched.