tailwindcss
4.3.5 · 6 Nov 2026MIT191M / weekRepositoryHomepagenpmAtom feed
241 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 3.x
3.0.17
26 Jan 2022Remove false positive warning in CLI when using the
--contentoption
3.0.16
24 Jan 2022Ensure to transpile the PostCSS Nesting plugin (tailwindcss/nesting)
Improve various warnings
Fix grammatical mistake
3.0.15
15 Jan 2022Temporarily remove optional chaining in nesting plugin
3.0.14
14 Jan 2022Show warnings for invalid content config
Only emit utility/component variants when those layers exist
Ensure nesting plugins can receive options
3.0.13
11 Jan 2022Fix consecutive builds with at apply producing different CSS
3.0.12
7 Jan 2022Allow use of falsy values in theme config
Ensure we can apply classes that are grouped with non-class selectors
Improve standalone CLI compatibility on Linux by switching to the
linuxstaticbuild target
Fixed
Allow use of falsy values in theme config
Ensure we can apply classes that are grouped with non-class selectors
Improve standalone CLI compatibility on Linux by switching to the
linuxstaticbuild targetEnsure
@applyworks consistently with or without@layerOnly emit defaults when using base layer
Emit plugin defaults regardless of usage
Move default border color back to preflight
Change
experimental.optimizeUniversalDefaultsto only work with@tailwind base
3.0.11
5 Jan 2022Preserve casing of CSS variables added by plugins
Ignore content paths that are passed in but don't actually exist
Revert change that applies Tailwind's defaults in isolated environments like CSS modules
3.0.9
3 Jan 2022- Removed
Remove support for
TAILWIND_MODE=watch Ensure we can use
<and>characters in modifiers
3.0.8
28 Dec 2021Reduce specificity of
abbrrule in preflightSupport HSL with hue units in arbitrary values
Add
node16-linux-arm64target for standalone CLI
3.0.7
17 Dec 2021Don't mutate custom color palette when overriding per-plugin colors
Improve circular dependency detection when using
@applyOnly generate variants for non-
userlayers
Fixed
Don't mutate custom color palette when overriding per-plugin colors
Improve circular dependency detection when using
@applyOnly generate variants for non-
userlayersProperly extract classes with arbitrary values in arrays and classes followed by escaped quotes
Improve jsx interpolation candidate matching
Ensure
@applyof a rule inside an AtRule works
3.0.6
16 Dec 2021Support square bracket notation in paths
Ensure all plugins are executed for a given candidate
Fixed
Support square bracket notation in paths
Ensure all plugins are executed for a given candidate
3.0.5
15 Dec 2021Add
lito list-style reset
3.0.4
15 Dec 2021Insert always-on defaults layer in correct spot
Fixed
Insert always-on defaults layer in correct spot
3.0.3
15 Dec 2021Warn about invalid globs in
contentAdd standalone tailwindcss CLI
Add
lito list-style reset
Added
Warn about invalid globs in
contentAdd standalone tailwindcss CLI
Add
lito list-style reset
Fixed
Don't output unparsable values
Fix text decoration utilities from overriding the new text decoration color/style/thickness utilities when used with a modifier
Move defaults to their own always-on layer
Support negative values in safelist patterns (6480)
3.0.2
13 Dec 2021Temporarily disable optimize universal defaults, fixes issue with transforms/filters/rings not being
@apply-able in CSS modules/Svelte components/Vue components
3.0.1
11 Dec 2021Ensure complex variants with multiple classes work
Re-add
defaultinterop to public available functionsDetect circular dependencies when using
@apply
Fixed
Ensure complex variants with multiple classes work
Re-add
defaultinterop to public available functionsDetect circular dependencies when using
@applyFix defaults optimization when vendor prefixes are involved
3.0.0
9 Dec 2021- Deprecated
Add
grow-*andshrink-*utilities, deprecateflex-grow-*andflex-shrink-* - Deprecated
Deprecate
decoration-sliceanddecoration-breakin favorbox-decoration-sliceandbox-decoration-break Add colored box shadow utilities
Tailwind CSS v3.0 is here — bringing incredible performance gains, huge workflow improvements, and a seriously ridiculous number of new features.
Read the announcement post for all the details.
Added
Add colored box shadow utilities
Add native
aspect-ratioutilitiesAdd
columnutilitiesAdd
break-before,break-insideandbreak-afterutilitiesAdd
text-indentutilitiesAdd
text-decoration-{color/style/thickness/offset}utilities (#5760, #6004)Add
outline-style,outline-color,outline-widthandoutline-offsetutilitiesAdd
align-subandalign-supervertical-align utilitiesAdd
accent-colorutilitiesAdd
scroll-snaputilitiesAdd
scroll-behaviorutilitiesAdd
flex-basisutilities- Deprecated
Add
grow-*andshrink-*utilities, deprecateflex-grow-*andflex-shrink-* Add
border-xandborder-ywidth and color utilitiesAdd
border-hiddenutilityAdd
overflow-clip,overflow-x-clipandoverflow-y-cliputilitiesAdd
inheritto default color paletteAdd full color palette for
fill-*andstroke-*utilitiesAdd
fit-contentvalues formin/max-width/heightutilitiesAdd
min/max-contentvalues formin/max-heightutilitiesAdd
will-changeutilitiesAdd all standard
cursor-*values by defaultAdd
printvariant for targeting printed mediaAdd
placeholdervariantAdd
filevariant for::file-selector-buttonpseudo elementAdd
[open]variantAdd
portraitandlandscapevariantsAdd
menureset to preflightAdd comprehensive "arbitrary value" support (#5568, #6233, #6259, #6258, #6283)
Add "arbitrary properties" support
Add new declarative
addVariantAPI
Changed
Remove AOT engine, make JIT the default
Enable extended color palette by default with updated color names
Rename
overflow-cliptotext-clipandoverflow-ellipsistotext-ellipsis- Deprecated
Deprecate
decoration-sliceanddecoration-breakin favorbox-decoration-sliceandbox-decoration-break Move
vertical-alignvalues to config file instead of hard-codingThrow when trying to
@applythegroupclassRemove dependency on
modern-normalize, inline and consolidate with PreflightRemove
prefixas a functionDon't use pointer cursor on disabled buttons by default
Set default content value in preflight instead of within each before/after utility
Preserve original color format when adding opacity whenever possible
Unify config callback helpers into single object
- 2.x
2.2.19
29 Oct 2021Ensure
corePluginsorder is consistent in AOT mode
2.2.18
29 Oct 2021- Security
Bump versions for security vulnerabilities
2.2.17
13 Oct 2021Configure chokidar's
awaitWriteFinishsetting to avoid occasional stale builds on Windows
2.2.16
26 Sep 2021JIT: Properly handle animations that use CSS custom properties
2.2.15
10 Sep 2021Ensure using CLI without
-ifor input file continues to work even though deprecated
2.2.14
8 Sep 2021Only use
@defaultsin JIT, switch back toclean-cssin case there's any meaningful differences in the output
2.2.13
8 Sep 2021Fix broken CDN build
2.2.12
8 Sep 2021Ensure that divide utilities inject a default border color
2.2.11
7 Sep 2021Rebundle to fix missing CLI peer dependencies
2.2.10
6 Sep 2021Fix build error when using
presets:in config fileReintroduce universal selector optimizations under experimental
optimizeUniversalDefaultsflag
2.2.9
30 Aug 2021JIT: Fix
@applying utilities that contain variants + the important modifierJIT: Don't strip "null" when parsing tracked file paths
Pin
clean-cssto v5.1.4 to fix empty CSS variables in CDN builds
2.2.8
27 Aug 2021Improve accessibility of default link focus styles in Firefox
JIT: Fix animation variants corrupting keyframes rules
JIT: Ignore escaped commas when splitting selectors to apply prefixes
Fixed
Improve accessibility of default link focus styles in Firefox
JIT: Fix animation variants corrupting keyframes rules
JIT: Ignore escaped commas when splitting selectors to apply prefixes
Nesting: Maintain PostCSS node sources when handling
@applyJIT: Fix support for animation lists
JIT: Fix arbitrary value support for
object-positionutilitiesCLI: Abort watcher if stdin is closed to avoid zombie processes
JIT: Ignore arbitrary values with unbalanced brackets
2.2.7
23 Jul 2021Temporarily revert runtime performance optimizations introduced in v2.2.5, use universal selector again
2.2.6
21 Jul 2021Fix issue where base styles not generated for translate transforms in JIT
2.2.5
21 Jul 2021Added
self-baselineutility (I know this is a patch release, no one's going to die relax)JIT: Optimize universal selector usage by inlining only the relevant selectors (#4850))
This provides a very significant performance boost on pages with a huge number of DOM nodes, but there's a chance it could be a breaking change in very rare edge cases we haven't thought of. Please open an issue if anything related to shadows, rings, transforms, filters, or backdrop-filters seems to be behaving differently after upgrading.
Fix support for
step-startandstep-endin animation utilities (#4795))
Added
Added
self-baselineutility (I know this is a patch release, no one's going to die relax)
Changed
JIT: Optimize universal selector usage by inlining only the relevant selectors (#4850))
This provides a very significant performance boost on pages with a huge number of DOM nodes, but there's a chance it could be a breaking change in very rare edge cases we haven't thought of. Please open an issue if anything related to shadows, rings, transforms, filters, or backdrop-filters seems to be behaving differently after upgrading.
Fixed
Fix support for
step-startandstep-endin animation utilities (#4795))JIT: Prevent presence of
!*in templates from ruining everything (#4816))JIT: Improve support for quotes in arbitrary values (#4817))
Fix filter/backdrop-filter/transform utilities being inserted into the wrong position if not all core plugins are enabled (#4852))
JIT: Fix
@layerrules being mistakenly inserted during incremental rebuilds (#4853))Improve build performance for projects with many small non-Tailwind stylesheets
Ensure
[hidden]works as expected on elements where we override the defaultdisplayvalue in PreflightFix variant configuration not being applied to
backdropOpacityutilities
2.2.4
23 Jun 2021Remove
postinstallscript that was preventing people from installing the library
2.2.3
23 Jun 2021Pass extended color palette to theme closures so it can be used without installing Tailwind when using
npx tailwindcssJIT: Explicitly error when
-is used as a custom separatorJIT: Don't add multiple
~when stackingpeer-*variants
Added
Pass extended color palette to theme closures so it can be used without installing Tailwind when using
npx tailwindcss
Fixed
JIT: Explicitly error when
-is used as a custom separatorJIT: Don't add multiple
~when stackingpeer-*variantsRemove outdated focus style fix in Preflight
Enable
purgeif provided on the CLIJIT: Fix error when not using a config file with postcss-cli
Fix issue with
resolveConfignot being importable in Next.js pages
2.2.2
18 Jun 2021- Breaking
JIT: Reintroduce
transform,filter, andbackdrop-filterclasses purely to create stacking contexts to minimize the impact of the breaking change
2.2.1
18 Jun 2021Recover from errors gracefully in CLI watch mode
Fix issue with media queries not being generated properly when using PostCSS 7
2.2.0
17 Jun 2021No installation or configuration necessary — simply
npx tailwindcss -o output.cssto compile Tailwind from anywhere. You can even enable JIT mode with the--jitflag and pass in your content files using the--purgeoption, all without creating a config file.Watch mode — so you can automatically rebuild your CSS whenever you make any changes.
JIT performance optimizations — since our CLI is Tailwind-specific we've been able to make tons of optimizations that make it the absolute fastest build tool for compiling your CSS in JIT mode.
Tailwind CSS v2.2.0
Six weeks ago I didn't even have v2.2 on my roadmap and yet somehow here we are today, with one of the biggest Tailwind CSS feature releases of all-time?!
This release is loaded with tons of cool new stuff, mostly targeting the new Just-in-Time mode which unlocks so many cool ideas we probably couldn't have pulled off if we had to keep being mindful of the CSS file size in development.
To upgrade, install the latest version via npm:
npm install -D tailwindcss@latest
Note that we've had to make a couple small changes to the JIT engine as we've added features, fixed bugs, and improved the overall reliability, so make sure to read about the changes and deprecations when upgrading if you are using just-in-time mode.
New features
All-new improved Tailwind CLI (#4526, #4558)
We've rewritten the Tailwind CLI tool from the ground-up with a performance-first mindset, while also adding support for a bunch of new features.
npx tailwindcss -o dist/tailwind.css --watch --jit --purge="./src/**/*.html"
Here are some of the highlights:
No installation or configuration necessary — simply
npx tailwindcss -o output.cssto compile Tailwind from anywhere. You can even enable JIT mode with the--jitflag and pass in your content files using the--purgeoption, all without creating a config file.Watch mode — so you can automatically rebuild your CSS whenever you make any changes.
JIT performance optimizations — since our CLI is Tailwind-specific we've been able to make tons of optimizations that make it the absolute fastest build tool for compiling your CSS in JIT mode.
Minification support — now you can minify your CSS with cssnano just by adding the
--minifyflag.PostCSS plugin support — the new CLI will read and respect any extra plugins you configure using a
postcss.config.jsfile.
It's fully backwards-compatible with the previous CLI, so if you've got any scripts set up already you should be able to upgrade to v2.2 without making any changes to your scripts.
Check out our updated Tailwind CLI documentation to learn more.
Note that if you were using the
tailwindcss-cliwrapper package, you can safely switch totailwindcssas we've managed to resolve the peer-dependency issues that forced us to create the wrapper package in the first place.Before and after pseudo-element variants
This feature is only available in Just-in-Time mode.
People have been asking for this for years and it's finally here! We've added first-party support for styling pseudo-elements like
beforeandafter:<div class="before:block before:bg-blue-500 after:flex after:bg-pink-300"></div>
We set
content: ""automatically any time you use abeforeoraftervariant to make sure the elements are rendered, but you can override it using the newcontentutilities which have full arbitrary value support:<div class="before:content-['hello'] before:block ..."></div>
You can even grab the content from an attribute using the CSS
attr()function:<div before="hello world" class="before:content-[attr(before)] before:block ..."></div>
This can be super helpful when your content has spaces in it, since spaces can't be used in CSS class names.
First-letter/line variants
This feature is only available in Just-in-Time mode.
We've added variants for the
first-letterandfirst-linepseudo-elements, so you can do stuff like drop caps:<p class="first-letter:text-4xl first-letter:font-bold first-letter:float-left"> The night was March 31, 1996, and it was finally time for Bret Hart to face off against Shawn Michaels in the long anticipated Iron Man match — a 60 minute war of endurance where the man who scored the most number of falls would walk away as the WWF World Heavyweight Champion. </p>
Selected text variants
This feature is only available in Just-in-Time mode.
We've added a new
selectionvariant that makes it super easy to style highlighted to match your design:<p class="selection:bg-pink-200"> After nearly a grueling hour of warfare with neither man scoring a fall, Hart locked in the Sharpshooter, his signature submission hold. As Michaels screamed in pain, the crowd were certain that Hart was about to walk away from WrestleMania XII as the still-World Heavyweight Champion. </p>
We've even built this feature in such a way that it can be applied to a parent element and cascade down, so you can set a highlight color for your whole site by applying a utility to the body:
<body class="selection:bg-pink-200"> <!-- ... --> <p> But Michaels didn't give up — he held on until the bell rang and the designated 60 minutes was up. Hart walked away content, thinking that without a clear winner, the title was his to hold. He was not prepared for what would happen next, when Gorilla Monsoon declared the match would continue under sudden death rules. </p> </body>List marker variants
This feature is only available in Just-in-Time mode.
You can use the new
markervariant to style the bullets or numbers at the beginning of a list:<h1>WrestleMania XII Results</h1> <ol class="marker:text-gray-500 marker:font-medium"> <li> The British Bulldog, Owen Hart, and Vader defeated Ahmed Johnson, Jake Roberts, and Yokozuna </li> <li>Roddy Piper defeated Goldust</li> <li>Stone Cold Steve Austin defeated Savio Vega</li> <li>The Ultimate Warrior defeated Hunter Hearst Helmsley</li> <li>The Undertaker defeated Diesel</li> <li>Shawn Michaels defeated Bret Hart</li> </ol>Like the
selectionvariant, we've implemented this in a way that it cascades from the parent, so you don't have to repeat it for each list item.Sibling selector variants
This feature is only available in Just-in-Time mode.
Tailwind CSS v2.2 adds new
peer-*variants that behave much like thegroup-*variants, but for targeting sibling elements instead of parent elements.This is useful for things like styling an element when a preceding checkbox is checked, doing things like floating labels, and lots more:
<label> <input type="checkbox" class="peer sr-only"> <span class="h-4 w-4 bg-gray-200 peer-checked:bg-blue-500"> <!-- ... --> </label>
Just like
groupcan be combined with any other variant,peercan as well, so you have variants likepeer-hover,peer-focus,peer-disabled, and loads more at your fingertips.The generated CSS uses the general sibling combinator and looks like this:
.peer:checked ~ .peer-checked\:bg-blue-500 { background-color: #3b82f6; }So just like in vanilla CSS, it will only work for targeting previous siblings, not siblings that appear later in the DOM.
Exhaustive pseudo-class support
This feature is only available in Just-in-Time mode.
We've added variants for basically every single missing pseudo-class we could think of in this release:
only(only-child)first-of-typelast-of-typeonly-of-typetargetdefaultindeterminateplaceholder-shownautofillrequiredvalidinvalidin-rangeout-of-range
Personal favorite in the list is
placeholder-shown— when combined with the new sibling selector variants it makes it possible to do cool stuff like floating labels:<div class="relative"> <input id="name" class="peer ..."> <label for="name" class="peer-placeholder-shown:top-4 peer-focus:top-0 ..."> </div>
Shorthand color opacity syntax
This feature is only available in Just-in-Time mode.
Instead of using utilities like
bg-opacity-50,text-opacity-25, orplaceholder-opacity-40, Tailwind CSS v2.2 gives you a new color opacity shorthand you can use to tweak the alpha channel of a color directly in the color utility itself:- <div class="bg-red-500 bg-opacity-25"> + <div class="bg-red-500/25">
This means you can now change the opacity of colors anywhere in Tailwind, even where we previously didn’t have specific opacity utilities, like in gradients for example:
<div class="bg-gradient-to-r from-red-500/50"></div>
The opacity values are taken from your
opacityscale, but you can also use arbitrary opacity values using square bracket notation:<div class="bg-red-500/[0.31]"></div>
If I'm being honest, I am more excited about never having to create another core plugin like
placeholderOpacity.jsfor you people again than I am about actually using the feature. And I'm really excited about the feature, so that says something.Extended arbitrary value support
This feature is only available in Just-in-Time mode.
We've gone over every core plugin in Tailwind to try and add the most flexible arbitrary value support we possibly could, and I think we've covered pretty much everything at this point.
You should be able to whatever arbitrary values you want, just about wherever you want:
<div class="col-start-[73] placeholder-[#aabbcc] object-[50%] ..."></div>
If you find one we missed, open an issue and we'll sort it out.
In addition to making arbitrary value support more comprehensive, we've also added a new type-hint syntax to handle ambiguous situations. For example, if you are using a CSS variable as an arbitrary value, it's not always clear what the generated CSS should be:
<!-- Is this a font size utility, or a text color utility? --> <div class="text-[var(--mystery-var)]"></div>
Now you can provide a hint to the engine by prefixing the arbitrary value with the type name:
<div class="text-[color:var(--mystery-var)]"></div>
Currently, the supported types are:
lengthcoloranglelist
We'll probably flesh this out even more over time as people discover new edge cases but this should get you very far.
Improved nesting support
Since Tailwind introduces a lot of non-standard CSS at-rules like
@tailwindand@apply, you can often run into weird output when combining it with a PostCSS nesting plugin likepostcss-nestedorpostcss-nesting.To ease the pain here, we've included a new PostCSS plugin in the
tailwindcsspackage that acts as a lightweight compatibility layer between existing nesting plugins and Tailwind itself.So if you need nesting support in your project, use our plugin, and stick it before Tailwind in your PostCSS plugin list:
// postcss.config.js module.exports = { plugins: [ // ... require('tailwindcss/nesting'), require('tailwindcss'), // ... ], }By default, it uses
postcss-nestedunder the hood (since that's what we use to support nesting in Tailwind plugins), but if you'd like to usepostcss-nestinginstead, just call our plugin as a function and pass through thepostcss-nestingplugin:// postcss.config.js module.exports = { plugins: [ // ... require('tailwindcss/nesting')(require('postcss-nesting')), require('tailwindcss'), // ... ], }Under the hood, this uses a new
screen()function we've introduced that you can use to get the expanded media expression from any of your configured breakpoints:/* Input */ @media screen(sm) { /* ... */ } /* Output */ @media (min-width: 640px) { /* ... */ }You probably won't need to use this yourself but it could be helpful if you're ever integrating Tailwind with another tool that understands
@mediabut doesn't handle@screenproperly.- @screen sm { /* ... */ } + @media screen(sm) { /* ... */ }Caret color utilities
This feature is only available in Just-in-Time mode.
You can now set the color of the cursor in form fields using the new
caret-{color}utilities:<input class="caret-red-500" />
These are customizable using the
caretColorkey in thethemesection of yourtailwind.config.jsfile.Background origin utilities
We've added new utilities for the
background-originproperty, which let you control where an element's background is positioned relative to the element's border, padding box, or content:<div class="bg-origin-border p-4 border-4 border-dashed ..." style="background-image: url(...)"> Background is rendered under the border </div> <div class="bg-origin-padding p-4 border-4 border-dashed ..." style="background-image: url(...)"> Background is rendered within the border but on top of any padding </div> <div class="bg-origin-content p-4 border-4 border-dashed ..." style="background-image: url(...)"> Background is rendered within any padding and under the content </div>
Learn more in the background origin documentation.
Simplified transform and filter composition (#4604, #4614)
This feature is only available in Just-in-Time mode.
The
transform,filter, andbackdrop-filterclasses are no longer necessary to "enable" their respective set of composable utilities.- <div class="transform scale-50 filter grayscale backdrop-filter backdrop-blur-sm"> + <div class="scale-50 grayscale backdrop-blur-sm">
Now those features are automatically enabled any time you use any of the relevant sub-utilities.
It's important to understand though that because these utilities aren't needed anymore, you can no longer expect transforms and filters to be "dormant" by default. If you were relying on conditionally "activating" transforms or filters by toggling these classes, you will want to make sure you are toggling the sub-utilities themselves instead:
- <div class="scale-105 -translate-y-1 hover:transform"> + <div class="hover:scale-105 hover:-translate-y-1">
I don't expect this will be a real problem for most people, but it's technically a breaking change which is why we've limited this improvment to the JIT engine only.
Per-side border color utilities
This feature is only available in Just-in-Time mode.
Requested at least once a month for the last four years, I'm excited to share that we've finally added per-side border color support now that we don't have to sweat the development stylesheet size.
<div class="border-2 border-t-blue-500 border-r-pink-500 border-b-green-500 border-l-yellow-500"> <!-- ... --> </div>
Go forth and build ugly websites! (Kidding, kidding, I know they are useful settle the hell down.)
Built-in safelist, transform, and extract support (#4469, #4580)
We've added first-class support for a bunch of important PurgeCSS features and made them work in the JIT engine as well, which doesn't actually even use PurgeCSS.
First is
safelist, which is super useful if you need to protect specific classes from being removed from your production CSS, perhaps because they are used in content that comes from a database or similar:// tailwind.config.js module.exports = { purge: { content: ['./src/**/*.html'], safelist: [ 'bg-blue-500', 'text-center', 'hover:opacity-100', // ... 'lg:text-right', ], }, // ... }Note that while the classic engine will accept regular expressions here, the JIT engine will not. That's because when we're generating classes on demand, the class doesn't exist until it's used so we have nothing to match the expression against. So if you're using just-in-time mode, make sure you're providing complete class names to get the expected result.
Next is
transform, which lets you transform content for different file extensions before scanning it for potential class names:// tailwind.config.js let remark = require('remark') module.exports = { purge: { content: ['./src/**/*.{html,md}'], transform: { md: (content) => { return remark().process(content) }, }, }, // ... }This is really useful if you have templates that are written in a language that compiles to HTML, like Markdown.
Finally we have
extract, which lets you customize the logic that Tailwind uses to detect class names in specific file types:// tailwind.config.js module.exports = { purge: { content: ['./src/**/*.{html,md}'], extract: { pug: (content) => { return /[^<>"'`\s]*/.match(content) }, }, }, // ... }This is an advanced feature and most users won’t need it. The default extraction logic in Tailwind works extremely well for almost all projects.
For more information on these features, check out our optimizing for production documentation.
Changes and deprecations
This release introduces a few small changes to the JIT engine that might impact you, and one deprecation:
It also introduces two minor deprecations for both engines, which are non-breaking for now but will become breaking changes in v3.0 so you are encouraged to account for:
New dependency tracking system for Just-in-Time mode
In Tailwind CSS v2.1, we tracked changes to your template files in just-in-time mode using our own separate watch process because most build tools were missing the APIs we needed to rebuild your CSS when template files changed using the watch system built-in to the build tool.
We've worked hard to make improvements to popular build tools over the past few months and change this, because using our own watch process makes builds prone to race conditions and very hard to debug problems.
So as of Tailwind CSS v2.2, the JIT engine relies on native dependency tracking in build tools by default, with an option to opt-in to the old system if your build tool doesn't support the APIs we need.
If you've followed along closely on GitHub or reported issues with watch mode, you may have seen us suggest using the
TAILWIND_DISABLE_TOUCH=trueflag — that mode is the default now in v2.2.This new dependency tracking system is compatible with at least the following tools:
Next.js (>= v10.2.2)
Vite (>= v2.3.8)
Webpack 4 (using latest
postcss-loader@^4)Webpack 5 (using latest
postcss-loader@^5)Rollup
Snowpack
Tools with known incompatibilities include:
postcss-cli
Parcel
If you discover your build tool isn't yet compatible with the new dependency tracking system, you have two options:
Compile your CSS separately using the new Tailwind CLI. You can use packages like
npm-run-allorconcurrentlyto compile your CSS alongside your usual development command by adding some scripts to your project like this:// package.json { // ... "scripts": { "dev": "npm-run-all --parallel dev:*", "dev:server": "vite", "dev:css": "tailwindcss -o src/tailwind.css -w", "build": "tailwindcss -o src/tailwind.css && vite build", "serve": "vite preview" }, }Set
TAILWIND_MODE=watchto opt-in to the old dependency tracking system. If the previous default was working for you, this will let you just keep using that system until the build tool you're using has been updated to support the new system.// package.json { // ... scripts: { // Set TAILWIND_MODE=watch when starting your dev server "dev": "TAILWIND_MODE=watch vite", // Do not set TAILWIND_MODE for one-off builds "build": "vite build", // ... }, // ... }Note that setting
TAILWIND_MODE=watchwill start a long-running watch process in the background, so if you set that environment variable when trying to do a one-off build, it will look like the build is hanging. You should only setTAILWIND_MODE=watchwhen you are actually running a dev server/watch process.
Transforms and filters don't need to be "enabled" in Just-in-Time mode
The
transform,filter, andbackdrop-filterclasses aren't necessary for "enabling" those features when using the JIT engine:- <div class="transform scale-50 filter grayscale backdrop-filter backdrop-blur-sm"> + <div class="scale-50 grayscale backdrop-blur-sm">
This means you can no longer expect transforms and filters to be dormant by default, and conditionally activated by adding
transform,filter, orbackdrop-filter.Instead, you will want put any variants on the sub-utilities themselves:
- <div class="scale-105 -translate-y-1 hover:transform"> + <div class="hover:scale-105 hover:-translate-y-1">
matchUtilitiesAPI changesThe
matchUtilitiesfunction that is used to register on-demand utilities in the JIT engine has changed significantly.We consider this private API still which is why we haven't documented it, but I know a few sneaky people out there are playing with it anyways.
To understand how the API works in v2.2, read the pull request that explains the changes.
Deprecate
@tailwind screensfor@tailwind variantsin Just-in-Time modeIn the classic engine, all utility variants are injected as part of the
@tailwind utilitiesdirective.In the JIT engine, variants like
hoverandfocusare injected in the same place as your responsive variants, which has traditionally been the very end of the stylesheet, or at@tailwind screensif you've included it explicitly.As of v2.2, the
@tailwind screensdirective has been renamed to@tailwind variants, since it is now the injection point for all variants, not just responsive variants.This directive is optional (just like
@tailwind screensalways has been) and is only useful if you want explicit control over where utility variants are injected. By default, they are always injected at the very end of your stylesheet.If you were using
@tailwind screensbefore, you should update your code to use@tailwind variants:@tailwind base; @tailwind components; @tailwind utilities; - @tailwind screens; + @tailwind variants; /* Some custom CSS... */
The
@tailwind variantsfeature is considered an advanced escape hatch and we recommend omitting it by default. You should only use it if your project won't work properly without it, which is only ever really true if you are introducing Tailwind to a legacy system with a very fragile existing CSS codebase that has styles that absolutely need to be at the very end of the stylesheet for things to work.Deprecate
lightBlueforskyin the extended color paletteThe
lightBluecolor in the extended color palette has been renamed tosky. It was the only oddball color in the list without a fancy name (likeemeraldorrose) and we just couldn't stomach it anymore.Using
lightBluewill still work until v3.0, but you'll see a warning in the console suggesting you use the new name.Note that it's totally okay to start using
skywithout actually updating your HTML, it's only at the place of import that the name matters:// tailwind.config.js let colors = require('tailwindcss/colors') module.exports = { theme: { colors: { // ... - 'light-blue': colors.lightBlue, + 'light-blue': colors.sky, } } }Deprecate
blur-0forblur-nonein the default themeFor some unknown reason when I released Tailwind CSS v2.1 I thought
blur-0was a better name thanblur-none, even though every other utility that uses a named size scale (likerounded-mdandshadow-lg) usenone, not0.In v2.2, we've added
blur-noneand stopped documentingblur-0. It still works, but it'll be removed from the default theme configuration in v3.0.- <div class="blur-0"> + <div class="blur-none">
Fixes and improvements
Alongside the new features this release introduces, we've also fixed a bunch of little things that might have been bugging you.
Here's a list of the fixes and improvements we've made since the last release, with links to the relevant pull requests to learn more:
JIT: Support applying important utility variants
JIT: Improve support for Svelte class bindings
JIT: Improve support for
calcandvarin arbitrary valuesConvert
hslcolors tohslawhen transforming for opacity support instead ofrgbaFix
backdropBlurvariants not being generatedImprove animation value parsing
Ignore unknown object types when hashing config
Ensure variants are grouped properly for plugins with order-dependent utilities
Resolve purge paths relative to
tailwind.config.jsinstead of the current working directoryJIT: Fix temp file storage when node temp directories are kept on a different drive than the project itself
Support border-opacity utilities alongside default
borderutilityJIT: Fix source maps for expanded
@tailwinddirectivesJIT: Ignore whitespace when collapsing adjacent rules
JIT: Generate group parent classes correctly when using custom separator
JIT: Fix incorrect stacking of multiple
groupvariantsJIT: Fix memory leak due to holding on to unused contexts
If you read this whole thing well damn, well done. Thanks as always for being part of the community and I hope you have fun with the new goodies!
2.1.4
2 Jun 2021Skip
rawPurgeCSS sources when registering template dependencies
2.1.3
1 Jun 2021Register PurgeCSS paths as PostCSS dependencies to guarantee proper cache-busting in webpack 5
2.1.2
23 Apr 2021Fix issue where JIT engine would generate the wrong CSS when using PostCSS 7
2.1.1
5 Apr 2021Fix issue where JIT engine would fail to compile when a source path isn't provided by the build runner for the current input file
2.1.0
5 Apr 2021The first new feature update since Tailwind CSS v2.0 is here and loaded with lots of cool stuff!
Tailwind CSS v2.1.0
The first new feature update since Tailwind CSS v2.0 is here and loaded with lots of cool stuff!
New features
JIT engine in core
The brand-new JIT engine we announced in March has now been merged into core, and is available as an opt-in feature using a new
modeoption in yourtailwind.config.jsfile:// tailwind.config.js module.exports = { mode: 'jit', purge: [ // ... ], // ... }This feature is still in preview which means some details may change as we iron out the kinks, and it's not subject to semantic versioning.
If you were using
@tailwindcss/jitbefore, you can now migrate to Tailwind CSS v2.1 instead, as that's where all new development on the engine will happen.New
filterandbackdrop-filterutilitiesThis is a huge one — we've finally added first-class support for CSS filters!
They work a lot like our
transformutilities, where you usefilterto enable filters, and combine it with utilities likegrayscale,blur-lg, orsaturate-200to compose filters on the fly.Here's what
filterlooks like:<div class="filter blur-md grayscale invert ..."> <!-- ... --> </div>
...and here's what
backdrop-filterlooks like:<div class="backdrop-filter backdrop-blur backdrop-brightness-50 ..."> <!-- ... --> </div>
Check out the filter and backdrop-filter to learn more. We'll add a bunch of helpful visual examples there soon!
New blending mode utilities
We've added brand new utilities for
mix-blend-modeandbackground-blend-mode:<div class="mix-blend-multiply ..."> <!-- ... --> </div>
Check out the documentation to learn more.
New
isolationutilitiesWe've added new
isolateandisolation-autoutilities for working with theisolationproperty:<div class="isolate ..."> <!-- ... --> </div>
This can be really helpful for scoping blending mode features or z-index adjustments and is super powerful. Check out the documentation to learn more.
I also highly recommend this great article by Josh Comeau to see it in action.
New
box-decoration-breakutilitiesWe've added brand new utilities for the
box-decoration-breakproperty:<div class="mix-blend-multiply ..."> <!-- ... --> </div>
It's a bit of an obscure one but it can be really useful alongside text gradients. Learn more in our documentation and in the MDN article.
New
inline-tableandlist-itemdisplay utilities (#3563, #3929)We've added a couple display utilities we were missing:
<div class="inline-table ..."> <!-- ... --> </div> <div class="list-item ..."> <!-- ... --> </div>
Maybe not quite as exciting as the rest but a welcome addition nonetheless.
2.0.3
7 Feb 2021Ensure sourcemap input is deterministic when using
@applyin Vue componentsEnsure placeholder opacity is consistent across browsers
Fix issue where
theme()didn't work with colors defined as functions
Fixed
Ensure sourcemap input is deterministic when using
@applyin Vue componentsEnsure placeholder opacity is consistent across browsers
Fix issue where
theme()didn't work with colors defined as functionsEnable
darkvariants by default for color opacity utilities
Added
Add support for a
tailwind.config.cjsfile in Node ESM projectsAdd version comment to Preflight
Add
cursor-helpby default
2.0.2
11 Dec 2020Fix issue with
@applynot working as expected with!importantinside an at-ruleFix issue with
@applynot working as expected with defined classesFix memory leak, and broken
@applywhen splitting up files
Fixed
Fix issue with
@applynot working as expected with!importantinside an at-ruleFix issue with
@applynot working as expected with defined classesFix memory leak, and broken
@applywhen splitting up files
Added
Add default values for the
ringutility
2.0.1
18 Nov 2020Nothing, just the only thing I could do when I found out npm won't let me publish the same version under two tags.
2.0.0
18 Nov 2020- Removed
Drop support for Node 8 and 10
- Removed
Removed
shadow-outline,shadow-solid, andshadow-xsby default in favor of newringAPI
Tailwind CSS v2.0, woohoo!
Read the blog post for more details.
Added
Add
overflow-ellipsisandoverflow-cliputilitiesAdd
transform-gputo force hardware acceleration on transforms when desiredAdd spacing scale to
insetpluginAdd percentage sizes to
translate,inset, andheightplugins (#2630, 5259560)Support using
@applywith complex classes, including variants likelg:hover:bg-blue-500Add new
2xlbreakpoint at 1536px by defaultAdd default line-height values for font-size utilities
Support defining theme values using arrays for CSS properties that support comma separated values
Enable
group-hoverfor color plugins,boxShadow, andtextDecorationby default (28985b6, f6923b1)Enable
focusfor z-index utilities by defaultSupport
extendinvariantsconfigurationAdd
max-w-proseclass by defaultSupport flattening deeply nested color objects
Support defining presets as functions
Enable
focus-withinfor all plugins that havefocusenabled by default (1a21f072, f6923b1)Added new
ringutilities for creating outline/focus rings using box shadows (#2747, 879f088, e0788ef)Added
5and95to opacity scaleAdd support for default duration and timing function values whenever enabling transitions
Changed
- Removed
Drop support for Node 8 and 10
Removed
targetfeature and dropped any compatibility with IE 11Upgrade to PostCSS 8 (but include PostCSS 7 compatibility build) (729b400, 1d8679d, c238ed1)
- Removed
Removed
shadow-outline,shadow-solid, andshadow-xsby default in favor of newringAPI Switch
normalize.csstomodern-normalizeRename
whitespace-no-wraptowhitespace-nowrapRename
flex-no-wraptoflex-nowrapRemove
clearfixutility, recommendflow-rootinsteadDisable
hoverandfocusforfontWeightutilities by defaultRemove
grid-gapfallbacks needed for old versions of SafariChange special use of 'default' in config to 'DEFAULT'
New
@applyimplementation, slight backwards incompatibilities with previous behaviorMake
themeretrieve the expected resolved value when theme value is complexMove
truncateclass totextOverflowcore pluginRemove
scrolling-touchandscrolling-autoutilitiesModernize default system font stacks
Upgrade to PurgeCSS 3.0
Change default
text-6xlfont-size to 3.75rem instead of 4remIgnore
[hidden]elements withinspaceanddivideutilities instead oftemplateelementsAutomatically prefix keyframes and animation names when a prefix is configured (#2621, #2641)
Merge
extendobjects deeply by defaultRespect
preserveHtmlElementsoption even when using custom PurgeCSS extractorNamespace all internal custom properties under
tw-to avoid collisions with end-user custom properties
- 1.x
1.9.6
23 Oct 2020The
presetsfeature had unexpected behavior where a preset config without its ownpresetskey would not extend the default config.If you were depending on this unexpected behavior, just add
presets:to your own preset to exclude the default configuration.
1.9.5
19 Oct 2020Fix issue where using
themewith default line-heights did not resolve correctly
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.