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.
1.9.4
17 Oct 2020Fix issue changing plugins defined using the
withOptionsAPI would not trigger rebuilds in watch processes
1.9.3
16 Oct 2020Fix issue where
tailwindcss init --fullscaffolded a corrupt config file (#2556)Remove console warnings about upcoming breaking changes (see note below)
Fix issue where
tailwindcss init --fullscaffolded a corrupt config file (#2556)Remove console warnings about upcoming breaking changes (see note below)
I've opted to remove the console notices about upcoming breaking changes (that encouraged users to opt-in to future features using the
futureoption in their config file.)While I had good intentions for this approach originally, I'm realizing now that it just ends up creating more confusion and a sloppier documentation story. Any breaking changes can't really be documented easily because the documentation needs to show the stable version of any given feature, since we can't assume someone has opted in to the new stuff.
This means that when someone does opt in, they are basically opting in to being out of sync with the documentation, which is a crappy experience for them, especially if they can't upgrade to Tailwind 2.0 in the near future because they need to support IE11.
For this reason I've decided to stop warning about the upcoming breaking changes so that we don't force users to opt-in to an essentially undocumented version of the framework. Instead we will continue to maintain the "upcoming changes" page in the docs, and continue to ship new ideas behind flags for people to test but without the nudge to upgrade. Folks who are comfortable opting-in to the new stuff early can do so, and folks that aren't can comfortably keep using things the way they are (along with complete documentation) and upgrade to the next version all at once, like people have done traditionally with most dependencies.
I will always strive to make breaking changes as painless and minimal as possible, so spending an hour to do the upgrade in one sitting is never going to be too bad. I highly value backwards compatibility and will never make needlessly breaking changes. An improvement is only worth making if it improves things enough to make up for the upgrade cost, and that's usually pretty rare. For example
lh-5might be a nicer class name thanleading-5but it is absolutely not worth breaking everyone's muscle memory and forcing them to replace hundreds of instances of classes in their projects. We'll only make breaking changes if they unlock meaningful new possibilities or fix fundamental problems that are holding people back.1.9.1
13 Oct 2020Don't import
corePluginsinresolveConfigto avoid bundling browser-incompatible code
1.9.0
12 Oct 2020Add new
presetsconfig optionScaffold new
tailwind.config.jsfiles with availablefutureflags commented outAdd
col-span-fullandrow-span-full
Tailwind CSS v1.9 is now available with a new
presetsfeature, some new utilities, and a few accessibility improvements. Check it out!New features
Add new
presetsconfig optionScaffold new
tailwind.config.jsfiles with availablefutureflags commented outAdd
col-span-fullandrow-span-fullMake
outlineconfigurable,outline-nonemore accessible by default, and addoutline-blackandoutline-whiteAdd additional small
rotateandskewvaluesAdd
xl,2xl, and3xlborder radius valuesAdd new utilities for
grid-auto-columnsandgrid-auto-rowsPromote
defaultLineHeightsandstandardFontWeightsfrom experimental to future
Fixed
Don't escape keyframe values
Use
word-wrapinstead ofoverflow-wrapinie11target mode
Experimental
Add experimental
2xlbreakpointRename
{u}-max-contentand{u}-min-contentutilities to{u}-maxand{u}-minin experimental extended spacing scaleSupport disabling dark mode variants globally
1.8.13
10 Oct 2020Support defining colors as closures even when opacity variables are not supported
1.8.12
7 Oct 2020Reset color opacity variable in utilities generated using closure colors
1.8.11
6 Oct 2020Make
tailwindcss.pluginwork in ESM environments for reasons
1.8.10
14 Sep 2020Prevent new
darkexperiment from causing third-partydarkvariants to inherit stacking behavior
1.8.8
11 Sep 2020Register dark mode plugin outside of
resolveConfigcode path
1.8.7
10 Sep 2020Fix issue where classes in escaped strings (like
class=\"block\") weren't extracted properly for purging
1.8.6
9 Sep 2020Fix issue where container padding not applied when using object syntax
1.8.5
7 Sep 2020Fix issue where
resolveConfigdidn't take into account configs added by feature flags
1.8.4
7 Sep 2020Fix issue where inserting extra PurgeCSS control comments could break integrated PurgeCSS support
Fix issue where dark variant in 'class' mode was incompatible with 'group-hover' variant
Support basic nesting structure with
@applywhen using theapplyComplexClassesexperiment
Fixed
Fix issue where inserting extra PurgeCSS control comments could break integrated PurgeCSS support
Fix issue where dark variant in 'class' mode was incompatible with 'group-hover' variant
Support basic nesting structure with
@applywhen using theapplyComplexClassesexperiment
Changed
Rename
font-hairlineandfont-thintofont-thinandfont-extralightbehindstandardFontWeightsflag (experimental until v1.9.0)
1.8.3
5 Sep 2020Fix issue where
font-variant-numericutilities would break in combination with most CSS minifier configurationsOnly warn about
conservativepurge mode being deprecated once per process
1.8.2
5 Sep 2020Fix bug where dark mode variants would cause an error if you had a
pluginsarray in your config
1.8.1
4 Sep 2020Fix bug in the new font-variant-numeric utilities which broke the whole rule
Fix bug while purging
1.8.0
4 Sep 2020Tailwind CSS v1.8 is now available with a handful of new utilities, a couple new features, and an exciting new experiment 🌚!
Tailwind CSS v1.8
Tailwind CSS v1.8 is now available with a handful of new utilities, a couple new features, and an exciting new experiment 🌚!
New features
New
font-variant-numericutilitiesWe've added a new composable API for the
font-variant-numericproperty, so now you can finally do the wholetabular-numsthing!Here's what's been added:
Class Description normal-numsReset font-variant-numerictonormalordinalEnables the ordinalfeatureslashed-zeroEnables the slashed-zerofeaturelining-numsEnables the lining-numsfeatureoldstyle-numsEnables the oldstyle-numsfeatureproportional-numsEnables the proportional-numsfeaturetabular-numsEnables the tabular-numsfeaturediagonal-fractionsEnables the diagonal-fractionsfeaturestacked-fractionsEnables the stacked-fractionsfeatureThe exciting thing about how these are implemented is that they are composable in your HTML, so you can enable multiple
font-variant-numericfeatures by adding multiple classes:<p class="slashed-zero tabular-nums diagonal-fractions">12345</p>
The
normal-numsclass can be used to reset things, usually used at a particular breakpoint:<p class="slashed-zero tabular-nums diagonal-fractions md:normal-nums">12345</p>
By default, only
responsivevariants are enabled for this new core plugin.New grid alignment utilities
We've added a bunch of new utilities for the
place-items,place-content,place-self,justify-items, andjustify-selfproperties!Here's a complete list of what has been added:
Core plugin Class CSS justifyItemsjustify-items-autojustify-items: autojustifyItemsjustify-items-startjustify-items: startjustifyItemsjustify-items-endjustify-items: endjustifyItemsjustify-items-centerjustify-items: centerjustifyItemsjustify-items-stretchjustify-items: stretchjustifySelfjustify-self-autojustify-self: autojustifySelfjustify-self-startjustify-self: startjustifySelfjustify-self-endjustify-self: endjustifySelfjustify-self-centerjustify-self: centerjustifySelfjustify-self-stretchjustify-self: stretchplaceContentplace-content-centerplace-content: centerplaceContentplace-content-startplace-content: startplaceContentplace-content-endplace-content: endplaceContentplace-content-betweenplace-content: space-betweenplaceContentplace-content-aroundplace-content: space-aroundplaceContentplace-content-evenlyplace-content: space-evenlyplaceContentplace-content-stretchplace-content: stretchplaceItemsplace-items-autoplace-items: autoplaceItemsplace-items-startplace-items: startplaceItemsplace-items-endplace-items: endplaceItemsplace-items-centerplace-items: centerplaceItemsplace-items-stretchplace-items: stretchplaceSelfplace-self-autoplace-self: autoplaceSelfplace-self-startplace-self: startplaceSelfplace-self-endplace-self: endplaceSelfplace-self-centerplace-self: centerplaceSelfplace-self-stretchplace-self: stretchBy default,
responsivevariants are generated for each of these new core plugins.New
preserveHtmlElementsoption forpurgeTailwind v1.8 introduces a new
preserveHtmlElementsoption to thepurgeconfiguration that allows you to safelist all plain HTML elements, likep,blockquote,body,video, etc.// tailwind.config.js module.exports = { purge: { content: [ // Paths... ], preserveHtmlElements: true, }, }This helps avoid accidentally purging things like heading elements when your source files are in a format that compiles to HTML, like markdown (since your markdown won't actually contain the string
h1anywhere).This option is set to
trueby default.New
layersmode forpurgeWe've introduced a new
layerspurge mode and made it the default, deprecating the existingconservativemode.When configured manually, it looks like this:
// tailwind.config.js module.exports = { purge: { mode: 'layers', layers: ['base', 'components', 'utilities'], content: [ // Paths... ], }, }It allows you to tell Tailwind which layers it should purge (base, components, and/or utilities). The old
conservativemode was the equivalent of this:// tailwind.config.js module.exports = { purge: { mode: 'layers', layers: ['utilities'], content: [ // Paths... ], }, }This is a breaking change (although it probably won't actually affect you), so to make it the default you'll have to opt-in behind the
purgeLayersByDefaultflag:// tailwind.config.js module.exports = { future: { purgeLayersByDefault: true, }, // ... }Support configuring variants as functions
Adding new variants to a core plugin is annoying right? You have to remember to list all of the existing variants, instead of just specying the new ones you want to add. Completely unacceptable!
Tailwind CSS v1.8 makes it possible to configure variants as functions so you can leverage some helpful utilities we expose to you that make it easy to extend the variant configuration instead of having to re-write the entire list:
// tailwind.config.js module.exports = { variants: { opacity: ({ before }) => before(['group-hover'], 'hover'), }, }Read the pull request for all of the details.
Dark mode (experimental)
Oh yeah I almost forgot, we added dark mode.
<div class="bg-white text-black dark:bg-black dark:text-white dark:hover:text-gray-300"></div>
It's stackable with both responsive variants and pseudo-class variants, so you can use classes like
lg:dark:focus:text-whiteno problem.It can be configured to use a
prefers-color-schememedia query or a parent class (.dark), whichever you prefer:module.exports = { dark: 'media', // or 'class' experimental { darkModeVariant: true, } }It's enabled for
backgroundColor,borderColor,divideColor,textColor,gradientColorStops, andplaceholderColorby default.It's experimental right now, so enable it using the
darkModeVariantexperimental flag:// tailwind.config.js module.exports = { experimental: { darkModeVariant: true, }, // ... }Let us know how it works for you and if there's anything we can improve before we tag it as stable!
Changes
@layerrules are now grouped togetherAny custom CSS defined within a
@layerat-rule that matches one of Tailwind's layers is now grouped together with the corresponding Tailwind rules.For example, this CSS:
@tailwind base; @tailwind components; @tailwind utilities; @layer components { .btn { background: blue; } } @layer utilities { .align-banana { text-align: banana; } } @layer base { h1 { font-weight: bold; } } @layer components { .card { border-radius: 12px; } } @layer base { p { font-weight: normal; } } @layer utilities { .align-sandwich { text-align: sandwich; } }...conceptually becomes this:
@tailwind base; h1 { font-weight: bold; } p { font-weight: normal; } @tailwind components; .btn { background: blue; } .card { border-radius: 12px; } @tailwind utilities; .align-banana { text-align: banana; } .align-sandwich { text-align: sandwich; }This is useful for avoiding CSS declaration order specificity issues and lets you decouple authoring order from intended render order. This is generally inline with the new
@layerCSS proposal that came out shortly after we introduced this at-rule to Tailwind ourselves without knowing that existed, heh.This is a change in behavior to how things worked before but we don't document the
@layerrule outside of mentioning it in the release notes for Tailwind 1.6. I am going to be a bit bold and classify this as a bugfix, as this is how this always should have worked. Basically a zero percent chance this will break anything for anyone.Deprecations
conservativepurge mode deprecated in favor oflayersThe new
layersmode replaces the oldconservativemode and will be the default in v2.0. You'll get a console warning until you update this value in your config file.If you want to update without any changes in behavior, use this configuration:
// tailwind.config.js module.exports = { purge: { mode: 'layers', layers: ['utilities'], content: [ // Paths... ], }, }1.7.6
29 Aug 2020Fix bug where the new experimental
@applyimplementation broke when applying a variant class with theimportantoption globally enabled
1.7.5
26 Aug 2020Update lodash to latest to silence security warnings
1.7.4
26 Aug 2020Fix bug where the new
applyComplexClassesexperiment didn't behave as expected with rules with multiple selectors, like.foo, .bar { color: red }Make
@applyinsensitive to whitespace in the newapplyComplexClassesexperimentAdd new
-pflag to CLI to quickly scaffold a postcss.config.js file
1.7.3
20 Aug 2020Fix bug that prevented defining colors as closures when the gradientColorStops plugin was enabled
Log feature flag notices to stderr instead of stdout to preserve compatibility with pipe-based build systems
Add missing
bg-noneutility for disabling background images
1.7.2
19 Aug 2020Reuse generated CSS as much as possible in long-running processes instead of needlessly recalculating
1.7.1
19 Aug 2020Don't issue duplicate flag notices in long-running build processes
1.7.0
18 Aug 2020Another new Tailwind release is here! This one sort of came out of nowhere and is loaded with exciting stuff (especially down in the experiments section...)
Tailwind v1.7.0
Another new Tailwind release is here! This one sort of came out of nowhere and is loaded with exciting stuff (especially down in the experiments section...)
Let's dig in!
New features
Gradients
The big one for this release — Tailwind now ships with built-in support for background gradients!
Gradients are designed with a highly composable API that lets you specify up to three color stops in one of 8 directions by default:
<div class="bg-gradient-to-r from-orange-400 via-red-500 to-pink-500"> <!-- ... --> </div>
!(user-images.githubusercontent.com/4323180/90427…)
This is made possible by a new
backgroundImagecore plugin (which you can use for any background images you like!) and a newgradientColorStopscore plugin.The default configuration for these plugins looks like this:
// tailwind.config.js module.exports = { theme: { backgroundImage: { 'gradient-to-t': 'linear-gradient(to top, var(--gradient-color-stops))', 'gradient-to-tr': 'linear-gradient(to top right, var(--gradient-color-stops))', 'gradient-to-r': 'linear-gradient(to right, var(--gradient-color-stops))', 'gradient-to-br': 'linear-gradient(to bottom right, var(--gradient-color-stops))', 'gradient-to-b': 'linear-gradient(to bottom, var(--gradient-color-stops))', 'gradient-to-bl': 'linear-gradient(to bottom left, var(--gradient-color-stops))', 'gradient-to-l': 'linear-gradient(to left, var(--gradient-color-stops))', 'gradient-to-tl': 'linear-gradient(to top left, var(--gradient-color-stops))', }, gradientColorStops: (theme) => theme('colors'), }, variants: { backgroundImage: ['responsive'], gradientColorStops: ['responsive', 'hover', 'focus'], }, }Learn more the original pull request.
New background-clip utilities
We've also added a new
backgroundClipcore plugin that you can use to control how background are rendered within an element.It includes 4 new utilities:
Class CSS bg-clip-borderbackground-clip: border-boxbg-clip-paddingbackground-clip: padding-boxbg-clip-contentbackground-clip: content-boxbg-clip-textbackground-clip: textCombined with the new gradient features, you can use this to do cool gradient text stuff like this:
<h1 class="text-6xl font-bold"> <span class="bg-clip-text text-transparent bg-gradient-to-r from-teal-400 to-blue-500"> Greetings from Tailwind v1.7. </span> </h1>!(user-images.githubusercontent.com/4323180/90427…)
Only responsive variants are enabled for the
backgroundClipplugin by default:// tailwind.config.js module.exports = { variants: { backgroundClip: ['responsive'], }, }New gap utility aliases
For some dumb reason I named the
column-gapandrow-gaputilitiescol-gap-{n}androw-gap-{n}respectively, which isn't terrible but it's not consistent with how other things in Tailwind are named.I was finding myself getting them wrong all the time — is
row-gapthe gaps in a row, or the gap between rows?Tailwind v1.7 introduces new
gap-x-{n}andgap-y-{n}utilities that do the exact same thing but have names that don't suck. They make way more sense than the actual CSS names now that gap for flexbox is starting to roll out too, since flexbox has no "columns".These utilities will replace the old ones in v2.0, but for now they both exist together.
We recommend migrating to the new names now, and disabling the old names using this feature flag:
// tailwind.config.js module.exports = { future: { removeDeprecatedGapUtilities: true, }, // ... }Tailwind will issue a warning in the console to remind you that you are including deprecated classes in your build until you enable this flag.
New
contentsdisplay utilityWe've added a new
contentsclass for the recentdisplay: contentsCSS feature.<div class="flex"> <div><!-- ... --></div> <!-- This container will act as a phantom container, and its children will be treated as part of the parent flex container --> <div class="contents"> <div><!-- ... --></div> <div><!-- ... --></div> </div> <div><!-- ... --></div> </div>Learn more about it in this great article by Rachel Andrew.
Default letter-spacing per font-size
You can now configure a default letter-spacing value for each font-size in your
tailwind.config.jstheme, using a tuple syntax:// tailwind.config.js module.exports = { theme: { fontSize: { 2xl: ['24px', { letterSpacing: '-0.01em', }], // Or with a default line-height as well 3xl: ['32px', { letterSpacing: '-0.02em', lineHeight: '40px', }], } } }This new syntax is supported in addition to the simpler
[{fontSize}, {lineHeight}]syntax that was recently introduced.Divide border styles
We've added utilities for setting the border style on the
divideutilities:<div class="divide-y divide-dashed"> <div><!-- ... --></div> <div><!-- ... --></div> <div><!-- ... --></div> <div><!-- ... --></div> </div>
These utilities include
responsivevariants by default:// tailwind.config.js module.exports = { variants: { divideStyle: ['responsive'], }, }Access entire config object from plugins
The
configfunction passed to the plugin API now returns the entire config option when invoked with no arguments:tailwind.plugin(function ({ config, addUtilities, /* ... */ })) { // Returns entire config object config() })Define colors as closures
You can now define your colors as callbacks, which receive a bag of parameters you can use to generate your color value.
This is particularly useful when trying to make your custom colors work with the
backgroundOpacity,textOpacity, etc. utilities// tailwind.config.js module.exports = { theme: { colors: { primary: ({ opacityVariable }) => `rgba(var(--color-primary), var(${variable}, 1))`, }, }, }Currently the only thing passed through is an
opacityVariableproperty, which contains the name of the current opacity variable (--background-opacity,--text-opacity, etc.) depending on which plugin is using the color.Deprecations
Tailwind v1.7 introduces a new feature flagging and deprecation system designed to make upgrades as painless as possible.
Any time we deprecate functionality or introduce new (stable) breaking changes, they will be available in Tailwind v1.x under a
futureproperty in yourtailwind.config.jsfile.Whenever there are deprecations or breaking changes available, Tailwind will warn you in the console on every build until you adopt the new changes and enable the flag in your config file:
risk - There are upcoming breaking changes: removeDeprecatedGapUtilities risk - We highly recommend opting-in to these changes now to simplify upgrading Tailwind in the future. risk - https://tailwindcss.com/docs/upcoming-changes
You can opt-in to a breaking change by setting that flag to
truein yourtailwind.config.jsfile:// tailwind.config.js module.exports = { future: { removeDeprecatedGapUtilities: true, }, }If you'd prefer not to opt-in but would like to silence the warning, explicitly set the flag to
false:// tailwind.config.js module.exports = { future: { removeDeprecatedGapUtilities: false, }, }We do not recommend this, as it will make upgrading to Tailwind v2.0 more difficult.
Deprecated gap utilities
As mentioned previously, Tailwind v1.7.0 introduces new
gap-x-{n}andgap-y-{n}utilities to replace the currentcol-gap-{n}androw-gap-{n}utilities.By default both classes will exist, but the old utilities will be removed in Tailwind v2.0.
To migrate to the new class names, simply replace any existing usage of the old names with the new names:
- <div class="col-gap-4 row-gap-2 ..."> + <div class="gap-x-4 gap-y-2 ...">
To opt-in to the new names now, enable the
removeDeprecatedGapUtilitiesflag in yourtailwind.config.jsfile:// tailwind.config.js module.exports = { future: { removeDeprecatedGapUtilities: true, }, }Experimental features
Tailwind v1.7.0 introduces a new experimental feature system that allows you to opt-in to new functionality that is coming to Tailwind soon but isn't quite stable yet.
It's important to note that experimental features may introduce breaking changes, do not follow semver, and can change at any time.
If you like to live on the wild side though, you can enable all of them like so:
// tailwind.config.js module.exports = { experimental: 'all', }With that out of the way, here is some of the fun stuff we're working on that we're pumped you can finally play with...
Use
@applywith variants and other complex classesThis is a huge one — you can finally use
@applywith responsive variants, pseudo-class variants, and other complex classes!.btn { @apply bg-indigo hover:bg-indigo-700 sm:text-lg; }There are a lot of details to understand with this one, so I recommend reading the pull request to learn about how it all works.
This introduces breaking changes to how
@applyworked before, so be sure to read all of the details before just flipping the switch.To enable this feature, use the
applyComplexClassesflag:// tailwind.config.js module.exports = { experimental: { applyComplexClasses: true, }, }New color palette
We've added a teaser of the new Tailwind 2.0 color palette that you can start playing with today using the
uniformColorPaletteflag:// tailwind.config.js module.exports = { experimental: { uniformColorPalette: true, }, }The idea behind the new palette is that every color at every shade has a similar perceived brightness. So you can swap
indigo-600withblue-600and expect the same color contrast.We do expect these colors to continue to change a lot as we iterate on them, so use these at your own risk.
Extended spacing scale
We've added a much bigger spacing scale that includes new micro values like
0.5,1.5,2.5, and3.5, as well as new large values like72,80, and96, and added percentage based fractional values to the whole spacing scale (1/2,5/6,7/12, etc.)You can enable the extended spacing scale using the
extendedSpacingScaleflag:// tailwind.config.js module.exports = { experimental: { extendedSpacingScale: true, }, }This is pretty stable, I would be surprised if we change this.
Default line-heights per font-size by default
We've added recommended default line-heights to every built-in font-size, which can be enabled using the
defaultLineHeightsflag:// tailwind.config.js module.exports = { experimental: { defaultLineHeights: true, }, }This is a breaking change and will impact your designs, as previously all font sizes had a default line-height of
1.5.Extended font size scale
We've added three new font sizes (
7xl,8xl, and9xl) to keep up with the latest huge-as-hell-hero-text trends. They include default line-heights as well.You can enable them under the
extendedFontSizeScaleflag:// tailwind.config.js module.exports = { experimental: { extendedFontSizeScale: true, }, }1.6.3
18 Aug 2020Fixes issue where
motion-safeandmotion-reducevariants didn't stack correctly withgroup-hovervariants
1.6.2
3 Aug 2020Fixes issue where
@keyframesrespecting theimportantoption would break animations in Chrome
1.6.1
2 Aug 2020Fixes an issue where animation keyframes weren't included in the build without
@tailwind base
1.6.0
28 Jul 2020animate-spinanimate-pinganimate-pulse
Tailwind CSS v1.6.0
It's like Tailwind CSS v1.5 except now there's animation support, overscroll utilities, and more! 🥳
There aren't supposed to be any breaking changes here, but I thought that last time too. If I did break something, first person to report it gets a Tailwind shirt 😘
New Features
Animation support (#2068)
Tailwind CSS v1.6 adds a brand new
animationcore plugin, with 4 general purpose animations included out of the box:animate-spinanimate-pinganimate-pulseanimate-bounce
<button type="button" class="bg-indigo-600 ..." disabled> <svg class="animate-spin h-5 w-5 mr-3 ..." viewBox="0 0 24 24"> <!-- ... --> </svg> Processing </button>These are completely customizable as always, using the
animationandkeyframessections of yourtailwind.config.jstheme:// tailwind.config.js module.exports = { theme: { extend: { animation: { wiggle: 'wiggle 1s ease-in-out infinite', }, keyframes: { wiggle: { '0%, 100%': { transform: 'rotate(-3deg)' }, '50%': { transform: 'rotate(3deg)' }, }, }, }, }, }For more information and a live demo, read the new animation documentation. For behind the scenes details about the design rationale, check out the pull request.
New
prefers-reduced-motionvariants (#2071)To go along with the new animation features, we've also added new
motion-safeandmotion-reducevariants that allow you to conditionally apply CSS based on theprefers-reduced-motionmedia feature.These can be useful in conjunction with transition and animation utilities to disable problematic motion for users who are sensitive to it:
<div class="... transition duration-150 ease-in-out motion-reduce:transition-none ..."></div>
...or to explicitly opt-in to motion to make sure it's only being shown to users who haven't opted out:
<div class="... motion-safe:transition duration-150 ease-in-out ..."></div>
These can be combined with responsive variants and pseudo-class variants as well:
<!-- With responsive variants --> <div class="sm:motion-reduce:translate-y-0"></div> <!-- With pseudo-class variants --> <div class="motion-reduce:hover:translate-y-0"></div> <!-- With responsive and pseudo-class variants --> <div class="sm:motion-reduce:hover:translate-y-0"></div>
These are currently not enabled for any utilities by default, but you can enabled them as needed in the
variantssection of yourtailwind.config.jsfile:// tailwind.config.js module.exports = { // ... variants: { translate: ['responsive', 'hover', 'focus', 'motion-safe', 'motion-reduce'], }, }For more details, check out the updated variants documentation.
New
overscroll-behaviorutilities (#2075)We've also added new utilities for the
overscroll-behaviorproperty.You can use these utilities to control how "scroll chaining" works in your sites, and avoid scrolling the whole page when you reach the top or bottom of an embedded scrollable area.
<div class="overscroll-y-contain ..."> <!-- ... --> </button>
Note that this is currently not supported in Safari, but in my opinion it's not a huge deal to treat this as a progressive enhancement anyways, since it falls back fairly gracefully.
This plugin can be configured in your
tailwind.config.jsfile asoverscrollBehavior:// tailwind.config.js module.exports = { // ... // Disabling the plugin corePlugins: { overscrollBehavior: false, }, // Customizing the enabled variants variants: { overscrollBehavior: ['responsive', 'hover'], }, }Generate your CSS without an input file (#1861)
If you never write any custom CSS and you're sick of creating this file all the time...
@tailwind base; @tailwind components; @tailwind utilities;
...then I've got news for you baby — if you're using our
tailwindcssCLI tool you can start depositing those 58 characters into your savings account instead of wasting them on a pointless CSS file.The input file argument is now optional in the CLI tool, so if you don't actually need a custom CSS file, you can just write this:
npx tailwindcss build -o compiled.css
Your kids are going to be so grateful for the extra time you get to spend together ❤️
1.5.2
21 Jul 2020Fixes issue where you could no longer use
@applywith unprefixed class names if you had configured a prefix
1.5.1
15 Jul 2020Fixes accidental breaking change where adding component variants using the old manual syntax (as recommended in the docs) stopped working
1.5.0
15 Jul 2020I was hoping to save v1.5.0 for something really exciting (🌘) but we needed a new feature to support the new @tailwindcss/typography plugin so h*ck it, we're dropping some new stuff on you early. Enjoy! 🥳
Tailwind CSS v1.5.0
I was hoping to save v1.5.0 for something really exciting (🌘) but we needed a new feature to support the new @tailwindcss/typography plugin so h*ck it, we're dropping some new stuff on you early. Enjoy! 🥳
No breaking changes, this is a minor release and we are professionals you silly goose.One accidental breaking change, fixed in v1.5.1. I take back everything I said about being professionals. I am the one who is the silly goose.New Features
Component
variantssupport (#2031)Until Tailwind CSS v1.5.0, only "utility" classes were really intended to be used with
variants(like "responsive", "hover", "focus", etc.)While these are still much more useful for utilities than any other type of class, we now support generating variants for component classes as well, like the
proseclasses in the new@tailwindcss/typographyplugin:<article class="prose md:prose-lg"> <!-- Content --> </article>
You can take advantage of this feature in your own component classes by using the new
variantsoption in the second argumant of theaddComponentsplugin API:plugin(function ({ addComponents })) { addComponents({ '.card': { // ... } }, { variants: ['responsive'] }) })...or using the array shorthand you might be familiar with from the
addUtilitiesAPI:plugin(function ({ addComponents })) { addComponents({ '.card': { // ... } }, ['responsive']) })To take advantage of these feature in your custom CSS (rather than using the plugin API), you can use a new
@layerdirective to explicitly tell Tailwind that your styles belong to the "components" bucket:@layer components { @responsive { .card { /* ... */ } } }This helps Tailwind purge your unused CSS correctly, ensuring it doesn't remove any responsive component variants when using the default "conservative" purge mode.
Responsive
containervariants (#2032)Piggy-backing off of the new component
variantssupport, thecontainerclass now supports variants!<!-- Only lock the width at `md` sizes and above --> <div class="md:container"> <!-- ... --> </div>
We've enabled responsive variants by default, but if you are sick in the head you can also manually enable other variants like
focus,group-hover, whatever:// tailwind.config.js module.exports = { // ... variants: { container: ['responsive', 'focus', 'group-hover'], }, }New
focus-visiblevariant (#1824)We've added support for the
:focus-visiblepseudo-class using a newfocus-visiblevariant.This is super useful for adding focus styles that only appear to keyboard users, and are ignored for mouse users:
<button class="focus-visible:outline-none focus-visible:shadow-outline ..."> Click me </button>
It's not enabled for anything by default, but you can enable it in the
variantssection of your config file:// tailwind.config.js module.exports = { // ... variants: { backgroundColor: ['responsive', 'hover', 'focus', 'focus-visible'], }, }Browser support is still pretty weak on this but getting better. In the mean time, check out the polyfill and corresponding PostCSS plugin if you'd like to use this in all browsers right away.
New
checkedvariant (#1285)We've added a new
checkedvariant you can use to conditionally style things like checkboxes and radio buttons:<input type="checkbox" class="bg-white checked:bg-blue-500" />
It's not enabled for anything by default, but you can enable it in the
variantssection of your config file:// tailwind.config.js module.exports = { // ... variants: { backgroundColor: ['responsive', 'hover', 'focus', 'checked'], }, }1.4.5
6 May 2020Fix bug where the
divideColorplugin was using the wrongvariantsin IE11 target mode
1.4.3
1 May 2020Don't generate unnecessary CSS in color plugins when color opacity utilities are disabled
1.4.2
1 May 2020Fix issue where
purge: { enabled: false }was ignored, addpurge: falseshorthand
1.4.0
29 Apr 2020IE 11 target mode (experimental)
bg-opacity-{value}text-opacity-{value}
Tailwind CSS v1.4.0
Another new minor version so soon? Merry Coronavirus 🎄😷🎄
New Features
IE 11 target mode (experimental)
New color opacity utilities (#1627)
Tailwind v1.4 adds a new set of utilities for controlling just the alpha channel of colors:
bg-opacity-{value}text-opacity-{value}border-opacity-{value}divide-opacity-{value}placeholder-opacity-{value}
These utilities compose with the existing color utilities like this:
<div class="bg-red-500 bg-opacity-25"> <!-- ... --> </div>
All of these new utilities inherit their values from the
opacityconfig by default but can be configured independently under the following theme keys:backgroundOpacitytextOpacityborderOpacityplaceholderOpacitydivideOpacity
Learn more in the pull request.
Built-in PurgeCSS (#1639)
Tailwind v1.4 adds a new
purgeoption to the config for removing unused CSS without the need for configuring another tool:// tailwind.config.js module.exports = { purge: [ './src/**/*.html', './src/**/*.vue', './src/**/*.jsx', ], theme: {}, variants: {}, plugins: [], }Learn more in the pull request and the updated "Controlling File Size" documentation.
IE 11 target mode (#1635)
This feature is experimental and may change outside of normal semantic versioning policies.
Recently we've been adding a lot of new features to Tailwind that aren't IE 11 compatible, and if you need to support IE 11 in your projects you have to be careful not to rely on these features by mistake.
To make this easier, we've added a new
targetoption to the config that lets you opt-in to a newie11mode that disables any features that are not compatible with IE 11:// tailwind.config.js module.exports = { target: 'ie11', theme: {}, variants: {}, plugins: [], }Learn more in the pull request.
1.3.5
23 Apr 2020Fix missing unit in calc bug in space plugin (
space-x-0didn't work for example)Drop
fs-extradependency to^8.0.0to preserve Node 8 compatibility until Tailwind 2.0
1.3.4
21 Apr 2020Fix bug where
divide-{x/y}-0utilities didn't work due to missing unit incalccall
1.3.3
21 Apr 2020Fix bug where the
divide-xutilities were not being applied correctly due to referencing--divide-y-reverseinstead of--divide-x-reverse
1.3.2
21 Apr 2020Add forgotten
responsivevariants forspace,divideWidth, anddivideColorutilities
1.3.1
21 Apr 2020Fix bug where the
space-xutilities were not being applied correctly due to referencing--space-y-reverseinstead of--space-x-reverse
1.3.0
21 Apr 2020They break down if your items wrap, you'll want to do something complicated with negative margins if you need to handle this
They break down if you start manually changing the order of things using the
orderproperty
Tailwind CSS v1.3.0
Holy crap a new Tailwind CSS release! We've got a few new goodies in this one, and I've made sure to put the most exciting ones at the top 🚀
New Features
New
spaceanddividelayout utilities (#1584, #1594)Prior to Tailwind v1.3, if you wanted to add some space or a border between elements, you had to manually add the necessary margin/border to all but one of the children:
<!-- Before --> <ul> <li>One</li> <li class="mt-4">Two</li> <li class="mt-4">Three</li> </ul>
Tailwind v1.3 introduces new
space-{x/y}-{n},divide-{x/y}-{n}, anddivide-{color}utilities for controlling this at the parent level instead, simplifying this common pattern into something concise and declarative that doesn't require all of that annoying duplication:<!-- After --> <ul class="space-y-4"> <li>One</li> <li>Two</li> <li>Three</li> </ul>
The
space-x-{n}utilities add a left margin to all but the first element, and thespace-y-{n}utilities add a top margin to all but the first element:<!-- Horizontal stack with 8px of space between each item --> <ul class="flex space-x-2"> <li>One</li> <li>Two</li> <li>Three</li> </ul> <!-- Vertical stack with 16px of space between each item --> <ul class="space-y-4"> <li>One</li> <li>Two</li> <li>Three</li> </ul>
The
spaceutilities inherit their configuration from the globalspacingconfiguration by default, and include negative variations like-space-x-2to create overlapping effects.The
divide-x-{n}utilities add a left border to all but the first element, and thedivide-y-{n}utilities add a top border to all but the first element:<!-- Horizontal list with 1px border between each item --> <ul class="flex divide-x"> <li>One</li> <li>Two</li> <li>Three</li> </ul> <!-- Vertical list with 1px border between each item --> <ul class="divide-y"> <li>One</li> <li>Two</li> <li>Three</li> </ul>
The
divideutilities inherit their configuration from theborderWidthconfiguration, and support thedefaultkeyword (set to 1px out of the box, like withborderWidth) so you can usedivide-yinstead ofdivide-y-1.The
divide-{color}utilities are used to set the color of the dividing borders:<!-- Vertical list with 1px blue border between each item --> <ul class="divide-y divide-blue-500"> <li>One</li> <li>Two</li> <li>Three</li> </ul>
We've also included
space-{x/y}-reverseanddivide-{x/y}-reverseutilities which can be useful if you are reversing the direction of items in a container using eitherflex-row-reverseorflex-col-reverse. These utilities swap left margins for right margins, top margins for bottom margins, left borders for right borders, and top borders for bottom borders to account for the items being in reverse order:<!-- Reversed horizontal list with 8px space between each item --> <ul class="flex flex-row-reverse space-x-2 space-x-reverse"> <li>One</li> <li>Two</li> <li>Three</li> </ul>
There are a couple limitations of our implementation that are worth pointing out:
They break down if your items wrap, you'll want to do something complicated with negative margins if you need to handle this
They break down if you start manually changing the order of things using the
orderproperty
Despite these limitations, I think you'll still find these incredibly useful. Eventually
gapwill have universal support in flexbox layouts and we can all rejoice.All of these utilities include
responsivevariants by default, and their values and variants can be customized using thespace,divideWidth, anddivideColorconfiguration keys respectively.New
transition-delayutilities (#1462)Tailwind v1.3 introduces new
delay-{amount}utilities for thetransition-delayproperty:<div class="transition ease-in-out duration-500 delay-1000"> <!-- ... --> </div>
We include the same values we do for the
duration-{amount}utilities and generateresponsivevariants by default:// tailwind.config.js module.exports = { theme: { // ... transitionDelay: { '75': '75ms', '100': '100ms', '150': '150ms', '200': '200ms', '300': '300ms', '500': '500ms', '700': '700ms', '1000': '1000ms', }, }, variants: { // ... transitionDelay: ['responsive'], }, // ... }New
group-focusvariant (#1577)We've added a new
group-focusvariant that works just like the existinggroup-hovervariant, but for focus states.This is useful when you want to add custom focus style to a button or link that has some nested child you want to style in a specific way, for example, changing the color of an icon inside of a button when the button is focused:
<button class="group text-gray-600 focus:bg-gray-100 focus:text-gray-700"> <svg class="h-6 w-6 text-gray-400 group-focus:text-gray-500"> <!-- ... --> </svg> Submit </button>This variant not enabled for any utilities by default, but can be enabled in the
variantssection of your config file.Support for specifying a default line-height for each font-size utility (#1532)
A common pattern we've run into in our own Tailwind projects is repeatedly pairing a font-size utility with a particular line-height utility, for example always using
text-smwithleading-5.Tailwind v1.3 now lets you specify a default line-height for each font-size utility in your config file, using a tuple of the form
[fontSize, lineHeight]:// tailwind.config.js module.exports = { theme: { fontSize: { // Will embed no line-height value sm: '12px', // Will use `font-size: 16px` and `line-height: 24px` md: ['16px', '24px'], }, }, }.text-sm { font-size: 12px; } .text-md { font-size: 16px; line-height: 24px; }The font-size utilities are generated before the line-height utilities in the final CSS, so you can still override the line-height for a particular font-size by simply adding a
leading-{size}utility:<!-- Will still be `line-height: 1`, even though the default line-height for `text-md` is `24px` (as per the example config above) --> <div class="text-md leading-none"></div>
We haven't changed the default config to include default line-heights as that would be a breaking change, but this is a feature we will likely take advantage of in Tailwind 2.0 sometime in the future.
Support for breakpoint-specific padding for
containerclass (#1398)Prior to v1.3, you could configure the
containerclass to have built-in horizontal padding like so:// tailwind.config.js module.exports = { theme: { container: { padding: '2rem', }, }, }Tailwind v1.3 enhances this functionality to allow you to specify a different amount of padding for each breakpoint:
// tailwind.config.js module.exports = { theme: { container: { padding: { default: '1rem', sm: '2rem', lg: '4rem', xl: '5rem', }, }, }, }Added
currentto the default color palette (#1438)The default color palette now includes
currentforcurrentColor, which simplifies some situations like creating buttons where the border color should match the text color:<!-- Before --> <button class="text-gray-500 hover:text-gray-700 focus:text-gray-700 border border-gray-500 hover:border-gray-700 focus:border-gray-700" > <!-- ... --> </button> <!-- Now --> <button class="text-gray-500 hover:text-gray-700 focus:text-gray-700 border border-current"> <!-- ... --> </button>
Since this color has been added to the default color palette, it is available for
textColor,borderColor,backgroundColor, andplaceholderColorutilities automatically.New
inline-gridutility (#1375)We've added an
inline-gridutility for settingdisplay: inline-grid. This probably should've been included in v1.2 and somehow got missed, but it's here now baby.<span class="inline-grid grid-cols-3 col-gap-4"> <!-- ... --> </span>
Will you ever use this? I never have, but it should still be there dammit.
New
flow-rootdisplay utility (#1247)We've added a new
flow-rootutility fordisplay: flow-root. Never heard of it? Me neither until it was PR'd.It behaves exactly like
display: blockwith one magical difference: it prevents collapsing margins!<div class="flow-root"> <!-- ... --> </div>
You'll start to find all sorts of useful use-cases for this if you pay attention, like completely obsoleting clearfix hacks.
New
clear-noneutility (#1413)This has been in the documentation for months but didn't actually exist in the framework — whoops.
It sets
clear: none, which is mostly useful for resetting theclearproperty at different breakpoints.<p class="clear-left md:clear-none"> <!-- ... --> </p>
Only two people noticed it was documented but missing, so odds are you don't even care that we added this.
1.2.0
5 Feb 2020This is probably the most exciting feature release in the history of Tailwind, so put on your seat belts.
Tailwind CSS v1.2.0
This is probably the most exciting feature release in the history of Tailwind, so put on your seat belts.
New Features
CSS Transition support (#1273)
Tailwind now includes utilities for setting the
transition-property,transition-duration, andtransition-timing-functionproperties.<button class="opacity-50 hover:opacity-100 transition-opacity duration-100 ease-out">...</button>
Expand to see the default values for these utilities
// tailwind.config.js module.exports = { theme: { // .transition-{property} transitionProperty: { none: 'none', all: 'all', default: 'background-color, border-color, color, fill, stroke, opacity, box-shadow, transform', colors: 'background-color, border-color, color, fill, stroke', opacity: 'opacity', shadow: 'box-shadow', transform: 'transform', }, // .ease-{timingFunction} transitionTimingFunction: { linear: 'linear', in: 'cubic-bezier(0.4, 0, 1, 1)', out: 'cubic-bezier(0, 0, 0.2, 1)', 'in-out': 'cubic-bezier(0.4, 0, 0.2, 1)', }, // .duration-{duration} transitionDuration: { '75': '75ms', '100': '100ms', '150': '150ms', '200': '200ms', '300': '300ms', '500': '500ms', '700': '700ms', '1000': '1000ms', }, } }For more information, check out the documentation.
CSS Transform support (#1272)
Tailwind now includes utilities for scaling, rotating, translating, and skewing elements.
<span class="transform scale-150 rotate-45 translate-x-full origin-center"></span>
Expand to see the default values for these utilities
// tailwind.config.js module.exports = { theme: { // .origin-{origin} transformOrigin: { center: 'center', top: 'top', 'top-right': 'top right', right: 'right', 'bottom-right': 'bottom right', bottom: 'bottom', 'bottom-left': 'bottom left', left: 'left', 'top-left': 'top left', }, // .scale-{scale} // .scale-x-{scale} // .scale-y-{scale} scale: { '0': '0', '50': '.5', '75': '.75', '90': '.9', '95': '.95', '100': '1', '105': '1.05', '110': '1.1', '125': '1.25', '150': '1.5', }, // .rotate-{angle} rotate: { '-180': '-180deg', '-90': '-90deg', '-45': '-45deg', '0': '0', '45': '45deg', '90': '90deg', '180': '180deg', }, // .translate-x-{distance} // .translate-y-{distance} // .-translate-x-{distance} // .-translate-y-{distance} translate: (theme, { negative }) => ({ ...theme('spacing'), ...negative(theme('spacing')), '-full': '-100%', '-1/2': '-50%', '1/2': '50%', full: '100%', }), // .skew-x-{amount} // .skew-y-{amount} skew: { '-12': '-12deg', '-6': '-6deg', '-3': '-3deg', '0': '0', '3': '3deg', '6': '6deg', '12': '12deg', }, } }One notable difference in how this works vs. other utilities in Tailwind is that the
transformutility acts sort of like a "toggle" — you need to add that class to "enable" transforms on an element but on its own it doesn't actually apply any transforms.You apply the actual transforms by stacking additional utilities for the types of transforms you'd like to apply, like
scale-150to scale an element to 150% of its size, orrotate-45to rotate it 45 degrees.To make it possible to compose multiple transforms like this, we've implemented this feature using CSS custom properties, which means transforms in Tailwind are not supported in IE11. If you need to support IE11 and would like to use transforms in your project, you'll need to write custom CSS as you would have in earlier versions of Tailwind.
For more information, check out the documentation.
CSS Grid utilities (#1274)
Tailwind now includes utilities for CSS Grid Layout.
<div class="grid grid-cols-2 lg:grid-cols-8 gap-6"> <div class="col-span-1 lg:col-span-3"></div> <div class="col-span-1 lg:col-span-3"></div> <div class="col-start-1 col-end-3 lg:col-start-4 lg:col-end-8"></div> <div class="col-span-1 col-start-1 lg:col-span-4 lg:col-start-2"></div> <div class="col-span-1 col-end-3 lg:col-span-6 lg:col-end-9"></div> </div>
Expand to see the default values for these utilities
// tailwind.config.js module.exports = { theme: { // .gap-{spacing}, .row-gap-{spacing}, .col-gap-{spacing} gap: theme => theme('spacing'), // .grid-cols-{cols} gridTemplateColumns: { none: 'none', '1': 'repeat(1, minmax(0, 1fr))', '2': 'repeat(2, minmax(0, 1fr))', '3': 'repeat(3, minmax(0, 1fr))', '4': 'repeat(4, minmax(0, 1fr))', '5': 'repeat(5, minmax(0, 1fr))', '6': 'repeat(6, minmax(0, 1fr))', '7': 'repeat(7, minmax(0, 1fr))', '8': 'repeat(8, minmax(0, 1fr))', '9': 'repeat(9, minmax(0, 1fr))', '10': 'repeat(10, minmax(0, 1fr))', '11': 'repeat(11, minmax(0, 1fr))', '12': 'repeat(12, minmax(0, 1fr))', }, // .col-{value} gridColumn: { auto: 'auto', 'span-1': 'span 1 / span 1', 'span-2': 'span 2 / span 2', 'span-3': 'span 3 / span 3', 'span-4': 'span 4 / span 4', 'span-5': 'span 5 / span 5', 'span-6': 'span 6 / span 6', 'span-7': 'span 7 / span 7', 'span-8': 'span 8 / span 8', 'span-9': 'span 9 / span 9', 'span-10': 'span 10 / span 10', 'span-11': 'span 11 / span 11', 'span-12': 'span 12 / span 12', }, // .col-start-{value} gridColumnStart: { auto: 'auto', '1': '1', '2': '2', '3': '3', '4': '4', '5': '5', '6': '6', '7': '7', '8': '8', '9': '9', '10': '10', '11': '11', '12': '12', '13': '13', }, // .col-end-{value} gridColumnEnd: { auto: 'auto', '1': '1', '2': '2', '3': '3', '4': '4', '5': '5', '6': '6', '7': '7', '8': '8', '9': '9', '10': '10', '11': '11', '12': '12', '13': '13', }, // .grid-rows-{rows} gridTemplateRows: { none: 'none', '1': 'repeat(1, minmax(0, 1fr))', '2': 'repeat(2, minmax(0, 1fr))', '3': 'repeat(3, minmax(0, 1fr))', '4': 'repeat(4, minmax(0, 1fr))', '5': 'repeat(5, minmax(0, 1fr))', '6': 'repeat(6, minmax(0, 1fr))', }, // .row-{value} gridRow: { auto: 'auto', 'span-1': 'span 1 / span 1', 'span-2': 'span 2 / span 2', 'span-3': 'span 3 / span 3', 'span-4': 'span 4 / span 4', 'span-5': 'span 5 / span 5', 'span-6': 'span 6 / span 6', }, // .row-start-{value} gridRowStart: { auto: 'auto', '1': '1', '2': '2', '3': '3', '4': '4', '5': '5', '6': '6', '7': '7', }, // .row-end-{value} gridRowEnd: { auto: 'auto', '1': '1', '2': '2', '3': '3', '4': '4', '5': '5', '6': '6', '7': '7', }, } }By default we ship the necessary utilities to construct grids with 1–12 explicit columns and 1-6 explicit rows and place elements anywhere in that grid.
Note that the approach we've taken to supporting CSS Grid is not compatible with IE11. For building grid layouts in older browsers, we recommend using Flexbox instead of CSS Grid.
For more information, check out the documentation.
Added max-w-{screen} utilities (#1284)
Tailwind's default
max-widthscale now includes values to match your breakpoints, taking the formmax-w-screen-{breakpointName}.<div class="max-w-screen-lg">...</div>
These are useful when you need behavior similar to the
containerclass but only for certain sizes.Added max-w-none utility (#1283)
Tailwind's default
max-widthscale now includes anonevalue for removing any max-width constraint an element might have.<div class="max-w-md lg:max-w-none">...</div>
Added rounded-md utility (#1281)
Tailwind's default
border-radiusscale now includes anmdvalue for giving an element a 6px border radius.<div class="rounded-md"></div>
Added shadow-sm utility (#1280)
Tailwind's default
box-shadowscale now includes ansmvalue for giving an element a very subtle small shadow — great for giving buttons or inputs a bit of depth without being super in-your-face.<div class="shadow-sm"></div>
For more information, check out the pull request.
Added shadow-xs utility (#1333)
Tailwind's default
box-shadowscale now includes anxsvalue for giving an element a very subtle outline shadow, very useful for stacking with other shadows when you need a tiny bit of extra distinction from the background.<div class="shadow-md rounded-md"> <div class="shadow-xs rounded-md"> <!-- ... --> </div> </div>For more information, check out the pull request.
Added stroke-width utilities (#1094)
Tailwind now includes utilities for controlling the
stroke-widthproperty of SVG elements.<svg class="stroke-2">...</svg>
Expand to see the default values for these utilities
// tailwind.config.js module.exports = { theme: { // .stroke-{width} strokeWidth: { '0': '0', '1': '1', '2': '2', } } }For more information, check out the documentation.
Added fixed line-height utilities (#1362)
Tailwind now includes a sensible set of fixed-value line-height utilities in addition to the existing relative line-height utilities.
<svg class="leading-5">...</svg>
Expand to see the default values for these utilities
// tailwind.config.js module.exports = { theme: { // .leading-{size} lineHeight: { none: '1', tight: '1.25', snug: '1.375', normal: '1.5', relaxed: '1.625', loose: '2', '3': '.75rem', '4': '1rem', '5': '1.25rem', '6': '1.5rem', '7': '1.75rem', '8': '2rem', '9': '2.25rem', '10': '2.5rem', } } }For more information, check out the documentation.
Added additional display utilities for table elements (#954)
Tailwind now includes a complete set of
displayutilities for table elements.<div class="table-header-group">...</div>
We've added
table-caption,table-column,table-column-group,table-footer-group,table-header-group, andtable-row-group.Added box-sizing utilities (#1031)
Tailwind now includes
box-borderandbox-contentutilities for setting thebox-sizingproperty of an element.<div class="box-content">...</div>
These can be useful when working with third party libraries that rely on the default browser value of
box-sizing: content-box, which we override in our base styles.For more information, check out the documentation.
Added clear utilities (#1051)
Tailwind now includes
clear-left,clear-right, andclear-bothutilities for clearing floats using theclearproperty.<div class="clear-left">...</div>
For more information, check out the documentation.
Config file dependencies are now watchable (#1072)
If you are
require-ing other modules inside yourtailwind.config.jsfile, those files will now be automatically watched for changes when running a webpack/PostCSS watcher.Previously, you'd have to restart your watcher any time you changed those files. Now those changes will be noticed automatically and your CSS will just rebuild as expected — hurray!
For more information, check out the pull request.
Added new
pluginandplugin.withOptionsAPIs (#1268)In prior versions of Tailwind, plugins were just simple anonymous functions:
// my-plugin.js module.exports = function ({ addUtilities, variants, theme }) { // ... }While this approach still works great and is 100% supported, Tailwind v1.2 adds two new official APIs for creating plugins that allow us to support some helpful new features.
The new
tailwindcss/pluginmodule exports a function that you can use to create a plugin like so:// my-plugin.js const plugin = require('tailwindcss/plugin') module.exports = plugin(function ({ addUtilities, variants, theme }) { // ... })You can also use
plugin.withOptionsto create a plugin that accepts some additional user configuration right in thepluginssection of your config:// my-plugin.js const plugin = require('tailwindcss/plugin') module.exports = plugin.withOptions(function (options) { return function ({ addUtilities, variants, theme }) { // ... } })Previously if you designed a plugin this way, users would have to make sure to invoke your plugin in their config, even if they had no custom configuration to provide:
// tailwind.config.js module.exports = { plugins: [ require('plugin-with-no-options'), require('plugin-that-has-options')(), ] }Now Tailwind is smart enough to invoke the function on the user's behalf, so if they don't want to provide any options, they can just require the plugin:
// tailwind.config.js module.exports = { plugins: [ require('plugin-with-no-options'), require('plugin-that-has-options'), ] }Allow plugins to extend the user's config (#1162)
Plugins can now extend the user's config file by providing their own configuration object as a second argument to the new
pluginAPI:// my-plugin.js const plugin = require('tailwindcss/plugin') module.exports = plugin(function ({ addUtilities, variants, theme }) { // ... }, { theme: { myPluginName: {...}, }, variants: { myPluginName: ['responsive'], } })This also works using the
plugin.withOptionsAPI, just pass a function that accepts your options and returns your config:// my-plugin.js const plugin = require('tailwindcss/plugin') module.exports = plugin.withOptions(function (options) { return function ({ addUtilities, variants, theme }) { // ... } }, function (options) { return { theme: { myPluginName: {...}, }, variants: { myPluginName: ['responsive'], } } })By providing your default theme values/variants this way, users can use Tailwind's
extendfeature to extend your defaults just like they can with core plugins.1.1.3
22 Oct 2019Fixes an issue where in some cases function properties in the user's
themeconfig didn't receive the second utils argument
1.1.2
14 Aug 2019Fixes a bug with horizontal rules where they were displayed with a 2px border instead of a 1px border
Fixes a bug with horizontal rules where they were rendered with default top/bottom margin
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.