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.x
1.1.1
9 Aug 2019Fixes issue where values like
autowould fail to make it through the default negative margin config
1.1.0
6 Aug 2019The first new feature release since v1.0 has arrived! Tailwind v1.1 includes a bunch of new stuff, but I think the things you'll probably be most excited about are:
Tailwind CSS v1.1
The first new feature release since v1.0 has arrived! Tailwind v1.1 includes a bunch of new stuff, but I think the things you'll probably be most excited about are:
Important note — although this is a minor release, it includes two bug fixes that may have a superficial impact on how your site looks if you are using horizontal rules in your site or are relying on the default placeholder color defined in Tailwind's base styles.
Be sure to read through the fixes section before upgrading to understand the impact.
Changes
New features
Added utilities for screenreader visibility (#964)
Tailwind now includes a new
accessibilitycore plugin that addssr-onlyandnot-sr-onlyutilities for controlling whether an element is visually hidden but still accessible to screen readers.Use
sr-onlyto hide an element visually without hiding it from screen readers:<a href="#"> <svg><!-- ... --></svg> <span class="sr-only">Settings</span> </a>
Use
not-sr-onlyto undosr-only, making an element visible to sighted users as well as screen readers. This can be useful when you want to visually hide something on small screens but show it on larger screens for example:<a href="#"> <svg><!-- ... --></svg> <span class="sr-only sm:not-sr-only">Settings</span> </a>
By default,
responsiveandfocusvariants are generated for these utilities. You can usefocus:not-sr-onlyto make an element visually hidden by default but visible when the user tabs to it — useful for "skip to content" links:<a href="#" class="sr-only focus:not-sr-only"> Skip to content </a>
You can customize which variants are generated by adding an
accessibilitykey to thevariantssection of your config file:// tailwind.config.js module.exports = { // ... variants: { accessibility: ['responsive', 'hover', 'focus', 'active'] } }Added utilities for placeholder color (#1063)
Tailwind now includes
placeholder-{color}utilities for setting the placeholder color of form elements:<input class="text-gray-900 placeholder-gray-500 ...">
By default,
responsiveandfocusvariants are generated for these utilities. You can customize which variants are generated by adding aplaceholderColorkey to thevariantssection of your config file:// tailwind.config.js module.exports = { // ... variants: { placeholderColor: ['responsive', 'hover', 'focus', 'active'] } }First, last, even, and odd child variants (#1024, #1027)
Tailwind now includes variants for targeting the
first-child,last-child,nth-child(odd), andnth-child(even)pseudo-classes.These allow you to apply a utility to an element only when it is the first, last, odd, or even child of its parent. Very useful for things like "put a border between all of these items that are generated in a loop" for example:
<ul> <li v-for="item in items" class="border-t first:border-t-0">{{ item }}</li> </ul>...or to add zebra striping to a table:
<table> <tr v-for="row in rows"> <td class="odd:bg-white even:bg-gray-200">...</td> <td class="odd:bg-white even:bg-gray-200">...</td> </tr> </table>The pseudo-classes map to variants as follows:
Pseudo-class Variant :first-childfirst:{utility}:last-childlast:{utility}:nth-child(odd)odd:{utility}:nth-child(even)even:{utility}Something worth emphasizing is that these variants apply to the child element itself, not to the children of the element with the utility. This is consistent with how other pseudo-class variants in Tailwind work, and how the
:first/last-childpseudo selectors work in CSS.Said again in code:
<!-- This is *not* how these variants are meant to be used --> <ul class="first:border-t-0"> <li v-for="item in items" class="border-t">{{ item }}</li> </ul> <!-- The utilities should be used on the child itself, not the parent --> <ul> <li v-for="item in items" class="border-t first:border-t-0">{{ item }}</li> </ul>These variants are disabled by default for all utilities, but can be enabled for each core plugin in the
variantssection of your config file:// tailwind.config.js module.exports = { // ... variants: { - backgroundColor: ['responsive', 'hover', 'focus'] + backgroundColor: ['responsive', 'first', 'last', 'even', 'odd', 'hover', 'focus'] } }Disabled variant (#732)
Tailwind now includes a
disabledvariant for styling elements when they are disabled:<input class="disabled:opacity-50 ...">
This variant is disabled by default for all utilities, but can be enabled for each core plugin in the
variantssection of your config file:// tailwind.config.js module.exports = { // ... variants: { - opacity: ['responsive', 'hover', 'focus'] + opacity: ['responsive', 'hover', 'focus', 'disabled'] } }Visited variant (#976)
Tailwind now includes a
visitedvariant for styling visited links:<a href="#" class="text-blue-500 visited:text-purple-500 ...">
This variant is disabled by default for all utilities, but can be enabled for each core plugin in the
variantssection of your config file:// tailwind.config.js module.exports = { // ... variants: { - textColor: ['responsive', 'hover', 'focus'] + textColor: ['responsive', 'hover', 'focus', 'visited'] } }Increase utility specificity using a scope instead of
!important(#1020)Prior to Tailwind v1.1, you may have used the
importantoption to make sure that no matter what, your utilities always took precedence over any other styles applied to an element:// tailwind.config.js module.exports = { important: true, // ... }This is a totally reasonable thing to do but it can introduce some issues when incorporating third-party JS libraries that add inline styles to your elements, because Tailwind's
importantutilities would defeat the inline styles. This is really common with animation libraries for example.Tailwind v1.1 adds the ability to make utilities "important" in a less aggressive manner by providing a selector instead of a boolean to the
importantoption:// tailwind.config.js module.exports = { important: '#app', // ... }What this will do is prefix all of your utilities with that selector, increasing their specificity without actually making them
!important.By using an ID for this selector and adding that ID to the root element of your site, all of Tailwind's utilities will have a high enough specificity to defeat all other classes used in your project without interfering with inline styles:
<html> <!-- ... --> <style> .high-specificity .nested .selector { color: blue; } </style> <body id="app"> <!-- Will be #bada55 --> <div class="high-specificity"> <div class="nested"> <!-- Will be red-500 --> <div class="selector text-red-500"><!-- ... --></div> </div> </div> <!-- Will be #bada55 --> <div class="text-red-500" style="color: #bada55;"><!-- ... --></div> </body> </html>If this seems weird or complicated to you, chances are you haven't run into this situation before and can just ignore this feature. If you've been bitten by this problem in the past though, you'll understand exactly why this feature was added.
Add hover/focus variants for opacity by default (#1065)
Opacity utilities now have
hoverandfocusvariants enabled by default:<div class="opacity-50 hover:opacity-100"><!-- ... --></div>
You can disable these if needed by overriding the default opacity variants in the
variantssection of your config file:// tailwind.config.js module.exports = { // ... variants: { + opacity: ['responsive'] } }Added
border-doubleutility (#1040)Tailwind now includes a
border-doubleutility for, well, giving elements a double border.<div class="border border-double"><!-- ... --></div>
Support negative prefix for boxShadow and letterSpacing plugins (#992)
The
boxShadowandletterSpacingplugins now support the negative modifier prefix likezIndex,margin, andinsetutilities do:// tailwind.config.js module.exports = { theme: { letterSpacing: { '-1': '-.05em', }, boxShadow: { '-sm': 'inset 0 2px 4px rgba(0,0,0.1)', }, } }This would generate classes like
-tracking-1and-shadow-sm, rather thantracking--1andshadow--smlike you might expect.Support passing config path via object (#1062)
When adding Tailwind to your PostCSS config, you can now specify the config file path using an object syntax instead of only a string:
// postcss.config.js module.exports = { plugins: [ // Existing syntax: require('tailwindcss')('custom-config.js'), // Added syntax: require('tailwindcss')({ config: 'custom-config.js' }), ] }This makes Tailwind compatible with PostCSS's object configuration syntax, which wasn't previously possible:
// postcss.config.js module.exports = { plugins: { tailwindcss: { config: 'custom-config.js' }, } }See the pull request for all of the details on how this works.
Fixes
Placeholders no longer have a default opacity (#1064)
Prior to v1.1, Tailwind included the following base styles for form elements:
input::placeholder, textarea::placeholder { color: inherit; opacity: 0.5; }Due to a bug in IE11, this mistakenly caused the
inputandtextareaelements themselves to be rendered at 50% opacity, not just the placeholders.We've fixed this in v1.1 by changing the base styles to this:
input::placeholder, textarea::placeholder { color: #a0aec0; }This sets the default placeholder to Tailwind's
gray-500color instead of inheriting the current color and changing the opacity.This means that if you weren't assigning a custom placeholder color to your form elements, they will now look a bit different than they did before.
This will be most apparent in situations where you have changed the text color of an input and were relying on the
inheritbehavior — for example an input with red text where you also want the placeholder to be red.Now that Tailwind includes placeholder color utilities, you can correct these superficial visual differences by adding a placeholder utility:
<input class="text-red-500 placeholder-red-300">
Make horizontal rules visible by default (#991)
Prior to v1.1, horizontal rules were mistakenly invisible in Tailwind because they had no border-width assigned.
Now
hrelements have a default border-width of1pxso they actually show up when you create one.This is technically a very minor breaking change in the event that you were actually depending on
hrelements not having a default border. You can remove the border by addingborder-0:<hr class="border-0">
Generate correct negative margins when using calc (#1058)
Negative margin values were calculated fairly naively in previous versions of Tailwind by simply prefixing the positive value with a
-. This of course didn't work if you were using more complex values likecalc(100vw - 10rem)orvar(--spacing-sm).Tailwind v1.1 fixes this issue by using
calcand thereduce-css-calcpackage to calculate the correct value to use.Read more about it in the pull request.
1.0.5
11 Jul 2019Support built-in variants for utilities that include pseudo-elements
Update several dependencies, including postcss-js which fixes an issue with using
!importantdirectly in Tailwind utility plugins
1.0.4
11 Jun 2019Increase precision of percentage width values to avoid 1px rounding issues in grid layouts
1.0.3
1 Jun 2019Throws an error when someone tries to use
@tailwind preflightinstead of@tailwind base, this is the source of many support requests
1.0.2
27 May 2019Fixes a bug where
@screenrules weren't bubbled properly when nested in plugins
1.0.1
13 May 2019Fixes a bug where global variants weren't properly merged
1.0.0
13 May 2019No release notes
- 0.7.x
0.7.4
23 Jan 2019Update our PostCSS related dependencies
Fix bug where class names containing a
.character had the responsive prefix added in the wrong place
0.7.3
13 Dec 2018Only updates a dependency:Normalize 8.0.1
0.7.2
5 Nov 2018Add
--no-autoprefixeroption to CLIbuildcommand
0.7.0
31 Oct 2018New Features
Changes
New Features
Registering new variants from plugins
Variant order can be customized per module
Added
focus-withinvariantFancy CLI updates
Option to generate config without comments
Make configured prefix optional when using
@applyImprove Flexbox behavior in IE 10/11
Changes
Variant order in modules is now significant
Normalize.css updated to v8.0.0
Removed CSS fix for Chrome 62 button border radius change
New Features
Registering new variants from plugins (#505)
(Introduced as an experiment in v0.6.2, now promoted to an official feature)
Plugins can now add their own variants (like
hover,focus,group-hover, etc.) to Tailwind.To get started, destructure the new
addVariantfunction from the object passed to your plugin, and call it with the name of the variant you'd like to add and a callback that can be used to manipulate the PostCSS nodes where the variant is being applied:module.exports = { plugins: [ function({ addVariant }) { addVariant('important', ({ container }) => { container.walkRules(rule => { rule.selector = `.\\!${rule.selector.slice(1)}` rule.walkDecls(decl => { decl.important = true }) }) }) } ] }Documentation is coming soon, but for now learn more in the pull request.
Variant order can be customized per module (#505)
(Introduced as an experiment in v0.6.2, now promoted to an official feature)
Variants are now generated in the order that they are specified in the
modulessection of your config file, rather than in a hard-coded static order like in previous versions of Tailwind.That means that if you want
focusvariants to defeathovervariants for background colors, but you want the opposite behavior for border colors, you can actually do that now by specifying the order in your config:modules.exports = { // ... modules: { // ... backgroundColors: ['responsive', 'hover', 'focus'], // ... borderColors: ['responsive', 'focus', 'hover'], // ... } }Note that this doesn't affect
responsivevariants — those are a special case since responsive versions are also generated for other variants, and we group responsive declarations to optimize the resulting CSS.Added
focus-withinvariant (#463)Tailwind now includes a
focus-withinvariant that you can use to change how an element is styled if an element inside of it has focus.<div class="focus-within:shadow-lg"> <label> <span>Email</span> <input type="email"> </label> </div>Learn about the
:focus-withinpseudo-class on MDNBy default we don't generate
focus-withinvariants for any utilities, but you can change this in the modules section your Tailwind configuration file:modules.exports = { // ... modules: { // ... - backgroundColors: ['responsive', 'hover', 'focus'], + backgroundColors: ['responsive', 'focus-within', 'hover', focus'], // ... } }Fancy CLI updates (#554)
Tailwind 0.7.0 includes a completely rewritten CLI tool with nicer output and a better user experience.
!(camo.githubusercontent.com/2d18b961dae3bc67bd85…)
All of the existing functionality is still there with the same API, it just looks better.
Option to generate config without comments (#558)
You can now use the
--no-commentsoption when runningtailwind initto generate a config file that excludes all of the inline documentation comments.This is a great way to make your config file easier to skim if you're an experienced Tailwind user who doesn't need the comments.
Make configured prefix optional when using
@apply(#553)If you're prefixing your generated utilities, including that prefix when using
@applyis now optional./* Before */ .my-component { @apply tw-bg-blue tw-text-white tw-font-bold; } /* Now */ .my-component { @apply bg-blue text-white font-bold; }You can continue to use the prefix if you like, or drop it if you prefer a terser syntax.
Improve Flexbox behavior in IE 10/11 (#550)
IE 10 and 11 interpret the shorthand
flexproperty differently than other browsers.Tailwind now specifies explicit grow, shrink, and basis values for the
flex-1,flex-auto, andflex-initialutilities for a more consistent cross-browser experience.Learn more at the flexbugs repo (bugs #4 and #6 specifically)
Changes
Variant order in modules config is now significant (#505)
Impact: Low, Effort: Low
Prior to 0.7.0, variants were always generated in the same order, regardless of the order specified in the
modulessection of your config file.Now, variants are generated in the they are specified. That means that if your config file currently lists variants in a different order than the <=0.6.6 default variant order, those variants will appear in a different order in your CSS.
To preserve the <=0.6.6 behavior, simply edit the
modulessection of your config file to make sure your variants are listed in the following order:modules.exports = { // ... modules: { // ... [anyModule]: ['group-hover', 'hover', 'focus-within', 'focus', 'active'] // ... } }Normalize.css updated to v8.0.0 (#537)
Impact: Low, Effort: Low
We've updated our dependency on Normalize.css from 7.0.0 to 8.0.0.
This drops support for very old browsers like IE9, Android 4.3, Safari 8, and iOS Safari 7-8.
If you still need to support those browsers, remove
@tailwind preflightfrom your CSS, add Normalize.css 7.0.0 to your project, and manually add our additional preflight base styles.Removed CSS fix for Chrome 62 button border radius change (#579)
Impact: Low, Effort: Low
When Chrome 62 was released, it introduced a user agent stylesheet change that added a default border radius to all buttons.
This messed up styles for like half of the internet (including sites like GitHub itself), so Chrome reverted the change in Chrome 63.
We included a fix for this in Tailwind with the intention to remove it when Chrome 62 was no longer in common use. Now that usage has dropped to 0.09%, we've removed our fix.
If this is a problem for you (it isn't), you can add the removed styles back to your project right after
@tailwind preflight.- 0.6.x
0.6.6
21 Sep 2018Promote
shadowLookupfrom experiment to official feature
0.6.5
14 Aug 2018Fixes an issue where units were stripped from zero value properties
0.6.4
16 Jul 2018Fixes an issue where changes to your configuration file were ignored when using
webpack --watch
0.6.3
11 Jul 2018Fixes an issue where
@tailwind utilitiesgenerated no output
0.6.2
11 Jul 2018New Features
Changes
Experiments
New Features
Added table layout utilities for styling tables
Configuration can now be passed as an object
Changes
Default config file changes
Experiments
Registering new variants from plugins
Allow
@apply-ing classes that aren't defined but would be generated
New Features
Added table layout utilities for styling tables (#504)
Tailwind now includes
.table-autoand.table-fixedutilities for controlling thetable-layoutproperty.By default we only generate responsive variants for these utilities but you can change this through the
tableLayoutmodule your Tailwind configuration file.We've also updated Preflight to set
border-collapse: collapseby default on all tables.Configuration can now be passed as an object (#508)
Normally you pass your configuration to Tailwind by giving it a path:
// .postcssrc.js or similar module.exports = { // ... plugins: [ // ... require('tailwindcss')('./tailwind.js'), ] }Now you can also pass an object directly:
// .postcssrc.js or similar const tailwindConfig = { // ... } module.exports = { // ... plugins: [ // ... require('tailwindcss')(tailwindConfig), ] }Note that we still recommend passing a path instead of an object, because Tailwind can't rebuild when the config changes if it doesn't have a config file to watch.
Changes
Default config file changes
Impact: Low, Effort: Low
The default config file now includes a new
tableLayoutentry in themodulessection.Simply add this to your config file to sync it with this change, or leave it out if you just want to inherit the default configuration for the new module:
module.exports = { // ... modules: { // ... svgStroke: [], + tableLayout: ['responsive'], textAlign: ['responsive'], // ... } }Experiments
Tailwind 0.6.2 includes two new major features that are disabled by default behind flags.
These features may be changed or removed at any time without any regard for semantic versioning, so please do not depend on them in production just yet.
Registering new variants from plugins (#505)
Plugins can now add their own variants (like
hover,focus,group-hover, etc.) to Tailwind.To get started, destructure the new
addVariantfunction from the object passed to your plugin, and call it with the name of the variant you'd like to add and a callback that can be used to manipulate the PostCSS nodes where the variant is being applied:module.exports = { plugins: [ function({ addVariant }) { addVariant('important', ({ container }) => { container.walkRules(rule => { rule.selector = `.\\!${rule.selector.slice(1)}` rule.walkDecls(decl => { decl.important = true }) }) }) } ] }Proper documentation will be provided when this feature is stable and official, but in the mean time you can learn more by reading this comment from the pull request.
To enable this experiment, add
pluginVariants: trueunder anexperimentskey in your Tailwind config:module.exports = { // ... experiments: { pluginVariants: true } }Allow
@apply-ing classes that aren't defined but would be generated (#516)You can now use
@applyto apply classes that aren't defined but would exist if@tailwind utilitieswas included in the same CSS file. This is mostly useful on projects that are setup to process multiple styles independently, for example a Vue.js project where you are using the<style>block of your single file components.To enable this experiment, add
shadowLookup: trueunder anexperimentskey in your Tailwind config:module.exports = { // ... experiments: { shadowLookup: true } }0.6.1
22 Jun 2018Fix incorrect box-shadow syntax for the
.shadow-outlineutility 🤦♂️If you generated a config file using v0.6.0, you'll want to make this same change in your own config file.
0.6.0
21 Jun 2018New Features
Changes
Focus variants for background colors
New Features
Added border collapse utilities for styling tables
Added more axis-specific overflow utilities
Added
.outline-noneutility for suppressing focus stylesAdded
.shadow-outlineutility as an alternative to default browser focus stylesExtended default padding, margin, negative margin, width, and height scales
Enable focus and hover variants for more modules by default
Changes
Removed default
outline: none !importantstyles from focusable but keyboard-inaccessible elementsMoved screen prefix for responsive
group-hovervariantsDefault config file changes
New Features
Added border collapse utilities for styling tables (#489)
Tailwind now includes
.border-collapseand.border-separateutilities for controlling theborder-collapseproperty.By default we don't generate any variants for these utilities (not even responsive variants) but you can change this through the
borderCollapsemodule your Tailwind configuration file.We've also updated Preflight to set
border-collapse: collapseby default on all tables.Added more axis-specific overflow utilities (#445)
In addition to
.overflow-hiddenand.overflow-visible, Tailwind now includes.overflow-x-hidden,.overflow-y-hidden,.overflow-x-visibleand.overflow-y-visiblefor controlling overflow along a specific axis.Added
.outline-noneutility for suppressing focus styles (#491)Tailwind now includes a
.outline-noneutility for settingoutline: 0on an element to prevent the default browser focus ring.By default, we also generate a focus variant (
focus:outline-none) but no responsive variants.Added
.shadow-outlineutility as an alternative to default browser focus styles (#491)Outlines don't follow an element's border radius in most browsers, so a common practice is disable the browser's default focus outline and use a colored
box-shadowto highlight focused elements.Tailwind now includes a blue
.shadow-outlineutility that can be used for this purpose.We've also enabled
focusvariants for box shadows by default, so you can add an outline shadow on focus by doing something like this:<button class="focus:outline-none focus:shadow-outline ..."></button>
Extended default padding, margin, negative margin, width, and height scales (#499)
Tailwind's default configuration now includes more padding, margin, and negative margin sizes:
padding/margin/negativeMargin: { 'px': '1px', '0': '0', '1': '0.25rem', '2': '0.5rem', '3': '0.75rem', '4': '1rem', + '5': '1.25rem', '6': '1.5rem', '8': '2rem', + '10': '2.5rem', + '12': '3rem', + '16': '4rem', + '20': '5rem', + '24': '6rem', + '32': '8rem', }We've also added
5to the height and width scales to avoid any holes when compared with the spacing scales:width/height: { 'auto': 'auto', 'px': '1px', '1': '0.25rem', '2': '0.5rem', '3': '0.75rem', '4': '1rem', + '5': '1.25rem', '6': '1.5rem', '8': '2rem', '10': '2.5rem', '12': '3rem', '16': '4rem', '24': '6rem', '32': '8rem', '48': '12rem', '64': '16rem', // ... }Enable focus and hover variants for more modules by default (#498)
Tailwind now includes focus and hover variants for more utilities out of the box.
We've added:
Focus variants for background colors
Focus variants for border colors
Focus variants for font weight
Hover and focus variants for box shadows
Focus variants for text colors
Focus variants for text style (underline, capitalization, etc.)
That means you do things like style an input differently based on whether it currently has focus:
<input class="border border-transparent bg-grey-lighter focus:bg-white focus:border-blue-light">
This was always possible if you had focus variants enabled in your own configuration, but Tailwind 0.6.0 sets these up for you out of the box so you don't need to make this common configuration change yourself. It also makes our CDN builds a little more powerful.
Changes
Removed default
outline: none !importantstyles from focusable but keyboard-inaccessible elements (#491)Impact: Low, Effort: Low
Prior to 0.6.0, our Preflight base styles included this rule (borrowed from suitcss/base):
/** * Suppress the focus outline on elements that cannot be accessed via keyboard. * This prevents an unwanted focus outline from appearing around elements that * might still respond to pointer events. */ [tabindex="-1"]:focus { outline: none !important; }This is a useful default for many projects, but in the odd case that it's problematic for you it is really annoying to work around.
With the addition of the
.outline-nonehelper, we think it makes sense to remove this default style and encourage people to simply addfocus:outline-noneto any focusable but keyboard-inaccessible elements:- <div tabindex="-1" class="...">...</div> + <div tabindex="-1" class="focus:outline-none ...">...</div>
Of course, you can also reintroduce this rule into your own base styles after Preflight:
@tailwind preflight; + [tabindex="-1"]:focus { + outline: none !important; + } @tailwind components; @tailwind utilities;Moved screen prefix for responsive
group-hovervariants (#497)Impact: Low, Effort: Medium
Prior to 0.6.0, if you had
responsiveandgroup-hovervariants enabled for a module, the resulting CSS rule for a responsive group-hover variant would look something like this:.sm\:group .group-hover\:bg-red { ... }This was just a consequence of the responsive variants implementation and wasn't something we intentionally designed. It allowed you to do stuff like this:
<!-- Parent only behaves like a group on large screens and up, so the child --> <!-- remains blue on small screens even when the parent is hovered. --> <div class="lg:group"> <div class="bg-blue group-hover:bg-red">...</div> </div>
This is not very useful in practice, and actually prevented you from changing how an element itself responded to group-hover on different screen sizes:
<div class="group"> <!-- Element was always red, even on small screens and up --> <div class="group-hover:bg-red sm:group-hover:bg-blue">...</div> </div>
In 0.6.0, the
group-hoverpart of the selector adopts the screen prefix instead of thegrouppart, so the code snippet from above will now work.I would bet $100 that zero Tailwind users were depending on the pre-0.6.0 behavior, but if you were, the best solution is to write your own CSS for those parts of your project.
Default config file changes
Impact: Low, Effort: Low
The default config file now includes more padding, margin, negative margin, height, and width sizes; a new
borderCollapseentry in themodulessection; and enables more variants for more modules by default.All the changes are purely additive, so you don't actually have to change any existing config files — all of your existing projects will work the same in 0.6.0 aside from the two breaking changes mentioned earlier in this changelog.
If you'd like to upgrade your config file to match the current default config file, you can view a diff of the changes here.
- 0.5.x
0.5.3
7 May 2018Improve sourcemaps for replaced styles like
preflightFix bug where informational messages were being logged to stdout during build, preventing the ability to use Tailwind's output in Unix pipelines
0.5.2
29 Mar 2018- Security
Fixes an issue with a dependency that had a security vulnerability
0.5.0
13 Mar 2018New Features
Changes
New Features
Plugin system
Added
.stickyposition utilityAdded
.cursor-waitand.cursor-moveutilitiesAdded
.bg-autobackground size utilityBackground sizes are now customizable
Support for
activevariantsBetter
postcss-importsupportConfiguration options for the
.containercomponent
Changes
The
.containercomponent is now a built-in pluginState variant precedence changes
New config file keys
.overflow-x/y-scrollnow setoverflow: scrollinstead ofoverflow: auto<strike>
.romanrenamed to.not-italic</strike>
New Features
Plugin system
Tailwind now includes a feature-rich plugin system that allows people to create reusable third-party packages that can hook into Tailwind's compilation process to add new styles.
// ... module.exports = { // ... plugins: [ function({ addUtilities, addComponents, config, prefix, e }) { addComponents( { ['.btn-blue']: { backgroundColor: 'blue', }, }, { respectPrefix: true } ) }, ], // ... }Documentation is coming very shortly, but in the mean time you can learn more through these two pull requests:
Update: Documentation is now available: tailwindcss.com/docs/plugins
Added
.stickyposition utilityTailwind now includes a
.stickyutility for setting an element toposition: sticky. This isn't supported by IE 11, but falls back fairly gracefully with no effort so we decided to include it out of the box.Learn more about sticky positioning at MDN
Added
.cursor-waitand.cursor-moveutilitiesIn addition to
.cursor-auto,.cursor-default,.cursor-pointer, and.cursor-not-allowed, Tailwind now includes.cursor-waitto indicate when the application is busy, and.cursor-moveto indicate that an element can be moved.Added
.bg-autobackground size utilityTo allow resetting an element's background size at other breakpoints, Tailwind now includes a
.bg-autoutility:<div class="bg-cover md:bg-auto">...</div>
Background sizes are now customizable
If you'd like to customize the available background size utilities in your project, you can now do so by adding a
backgroundSizekey to your Tailwind config:module.exports = { // ... backgroundSize: { 'auto': 'auto', 'cover': 'cover', 'contain': 'contain', }, }Support for
activevariantsIn addition to
hover,focus, andgroup-hover, Tailwind now includes support foractivevariants of each utility:module.exports = { // ... modules: { // ... backgroundColors: ['hover', 'active'], // ... } }Better
postcss-importsupportIf you're using
postcss-importto inline your imports, you can't use@tailwind preflightor@tailwind utilitiesdirectly in a file that contains other imports, due topostcss-importstaying strict to the CSS spec for import statements.Previously, the workaround for this was to create a new file just for
@tailwind preflightand another new file just for@tailwind utilities, and then@importthose files into your main stylesheet.It turns out
postcss-importcan import files fromnode_modules, so as of v0.5.0, you can now import these files directly from Tailwind itself:@import "tailwindcss/preflight"; @import "tailwindcss/utilities";
Configuration options for the
.containercomponentNow that the
.containercomponent is provided as a built-in plugin, it exposes optional configuration for centering the container by default as well as adding default horizontal padding:// ... module.exports = { // ... plugins: [ require('tailwindcss/plugins/container')({ center: true, padding: '2rem', }), ], }Containers are still not centered with no padding by default, and the configuration object is not required:
// ... module.exports = { // ... plugins: [ require('tailwindcss/plugins/container')(), ], }You can also disable the container component entirely now by removing the plugin from the plugins list:
// ... module.exports = { // ... plugins: [ - require('tailwindcss/plugins/container')(), ], }Changes
The
.containercomponent is now a built-in pluginImpact: Large, Effort: Low
The
.containercomponent has long been a bit of an oddball in the Tailwind codebase; it's the only set of styles that can't be used with state variants and apply different styles at different breakpoints.With the addition of the new plugin system, it made sense to move the container component out of same bucket of code that holds all of our utility classes and into its own plugin with its own options.
If you are using the container in your projects, you will need to add the following section to your existing Tailwind config file:
// ... module.exports = { // ... + plugins: [ + require('tailwindcss/plugins/container')(), + ], }You'll also need to add the new
@tailwind componentsdirective to your CSS:@tailwind preflight; + @tailwind components; @tailwind utilities;
State variant precedence changes
Impact: Small, Effort: High
Prior to 0.5.0, state variants had the following precedence (lowest to highest):
Focus
Hover
Group Hover
That means that if an element had both
focus:bg-blueandhover:bg-greenapplied, when the element was both focused and hovered, the hover styles would take precedence, so the element would be green.It also meant that if an element had
group-hover:bg-blueandhover:bg-greenapplied, hovering the element would make it blue because the group styles would take precedence over the individual element styles.In 0.5.0, state variants have the following precedence (lowest to highest):
Group Hover
Hover
Focus
Active
Now
hoverstyles will defeatgroup-hoverstyles, andfocusstyles will defeathoverstyles.If this sounds counter-intuitive, see #417 for more information on the motivation behind this change.
It is extremely unlikely that this change affects you; the odds that you were changing the same property on both hover and focus is extremely low, and if you were, I'm willing to bet it was on an
inputfield where the new behavior would actually feel like an improvement.If this change does break the expected behavior in your project, the best solution is to create your own component classes for the places where you were doing complex interaction like this so you can control the precedence manually.
New config file keys
Impact: Small, Effort: Low
New
pluginskeyIf you'd like to use the new plugin system in an existing project, you'll need to add the
pluginskey to your config, and include the container component plugin if you need it:// ... module.exports = { // ... + plugins: [ + require('tailwindcss/plugins/container')(), + ], }This is optional, your project will build fine without this change and will just fall back to the
pluginsconfiguration from the default config file.New
backgroundSizekeyIf you'd like to customize the available background size utilities, add the
backgroundSizekey to your configmodule.exports = { // ... + backgroundSize: { + 'auto': 'auto', + 'cover': 'cover', + 'contain': 'contain', + }, }This is optional, your project will build fine without this change and will just fall back to the
backgroundSizeconfiguration from the default config file..overflow-x/y-scrollnow setoverflow: scrollinstead ofoverflow: autoImpact: Large, Effort: Medium
The
.overflow-x-scrolland.overflow-y-scrollutilities now setoverflowtoscrollinstead ofauto.New
.overflow-x-autoand.overflow-y-autoutilities have been added to get theautobehavior with more consistent naming.This change won't break any sites but will cause scrollbars to appear on Windows in places where they might not be actually needed, so if you don't want them visible you should switch instances of
.overflow-x/y-scrollto.overflow-x/y-auto.We've also removed the
-ms-overflow-style: -ms-autohiding-scrollbarstyles from the overflow utilities, which means scrollbars will now render with their default styling in IE/Edge instead of being forced to render as autohiding, which is not the browsers normal behavior..romanrenamed to.not-italicImpact: Large, Effort: MediumThe.romanutility for undoing italic font styles has been renamed to.not-italicsince.romanis a terrible name.This was immediately reverted in v0.5.1 because it breaks compatibility with cssnext; ignore this change.
Hoping to change this in a future breaking release if/once the issue with
postcss-selector-notis resolved.- 0.4.x
0.4.3
5 Mar 2018Use
global.Objectto avoid issues with polyfills when importing the Tailwind config into other JS
0.4.0
15 Dec 2017New Features
Changes
The dark end of the grey scale has been spread out more, making
greycloser togrey-lightthan it was previously. See the PR.
New Features
@apply'd classes can now be made!importantexplicitly
Changes
@applynow strips!importantfrom any mixed in classesDefault color palette tweaks
New Features
@apply'd classes can now be made!importantexplicitlyIf you need to
@applya class and make it's declarations!important, you can now add!importantto the@applydeclaration itself. This will make the applied declarations!importanteven if they aren't marked as important in the class being applied:// Input: .bar { @apply .foo !important; } .foo { color: blue; } // Output: .bar { color: blue !important; } .foo { color: blue; }Changes
@applynow strips!importantfrom any mixed in classesImpact: Low
Prior to 0.4, if you had a class that contained
!importantdeclarations and you@apply'd that class to another class, the declarations would preserve their!importantvalue:// Input: .bar { @apply .foo; } .foo { color: blue !important; } // Output: .bar { color: blue !important; } .foo { color: blue !important; }This turned out to be problematic if you have Tailwind configured to make utilities
!importantby default, and you wanted to compose components from those utilities that contained descendant selectors, for example:// Input: .custom-table td { @apply .text-grey-dark; } // Output: .custom-table td { color: #8795a1 !important; }The problem was that rules like this would have a higher specificity than the utilities themselves due to the compound selector, so you couldn't override those styles with utilities:
<table class="custom-table"> <tr> <td class="text-red">Will still be grey</td> </tr> </table>In 0.4,
@applywill always strip!importantto avoid specificity issues like this:// Input: .bar { @apply .foo; } .foo { color: blue !important; } // Output: .bar { color: blue; } .foo { color: blue !important; }Odds of this affecting your existing codebase is quite low; if anything this will let you clean up code you might have had to write to work around this annoying behavior.
Default color palette tweaks
Impact: Low
Some of the values in the default color palette have been tweaked with the aim of making it more useful in more situations.
The dark end of the grey scale has been spread out more, making
greycloser togrey-lightthan it was previously. See the PR.The darker/darkest variants of most colors have been desaturated slightly so they work better as background colors. See the PR.
These changes will only affect you if you are dynamically referencing the default color palette in your own config file. If you'd like to keep using the old colors, they can be found here:
- 0.3.x
0.3.0
1 Dec 2017- Breaking
Simply re-add the base styles above to your own CSS.
- Breaking
Add the
fill-currentclass to any SVG elements that should be filled with the current text color. New Features
New Features
Enable/disable modules and control which variants are generated for each
Focus variants
Group hover variants
New
@variantsat-ruleCustomize the separator character
Missing config keys now fallback to their default values
New utilities
Upgrade Guide / Breaking Changes
Lists now have no margins by default
.pinno longer sets width and height to 100%SVG
fillno longer defaults tocurrentColor
New Features
Enable/disable modules and control which variants are generated for each
The Tailwind config file now contains a new
moduleskey where you can control which modules should be responsive, or have hover or focus variants generated:// ... module.exports = { // ... modules: { // Generate base appearance utilities + responsive versions appearance: ['responsive'], // Generate base, responsive, hover, and focus versions backgroundAttachment: ['responsive', 'hover', 'focus'], // Only generate base utilities backgroundPosition: [], // ... }, // ... }If you don't need a certain module at all, you can disable it by setting it to
false:// ... module.exports = { // ... modules: { // ... flexbox: false, // ... }, // ... }This gives you better control over the generated file size and also lets you add hover/focus variants to utilities that don't have them by default, like shadows for example.
If you're a PurgeCSS user who doesn't care about the pre-PurgeCSS file size, you can even set
modulestoallto generate every variant for every utility :feelsgood:// ... module.exports = { // ... modules: 'all', // ... }Learn more about in the configuration modules documentation.
Focus variants
As alluded to earlier, Tailwind now lets you generate
focus:variants of each utility that are only active on focus.Focus variants are currently not enabled on any modules by default, but you can enable them for a specific module in your own project by adding
'focus'to the variants list in themodulessection of your config file:// ... module.exports = { // ... modules: { // ... backgroundColors: ['responsive', 'hover', 'focus'], // ... }, // ... }Focus variants work just like the hover variants that you're used to:
<input class="bg-grey-light focus:bg-white border border-grey">
Group hover variants
Sometimes you need to change the style of an element when some parent element is hovered rather than the element itself.
To handle these situations, Tailwind 0.3 adds a new
group-hovervariant.Group hover variants are currently not enabled on any modules by default, but you can enable them for a specific module in your own project by adding
'group-hover'to the variants list in themodulessection of your config file:// ... module.exports = { // ... modules: { // ... textColors: ['responsive', 'hover', 'group-hover'], // ... }, // ... }To use a
group-hover:utility variant, you need to mark the target parent element with the.groupclass:<div class="group ..."> <svg class="text-grey-light group-hover:text-grey-dark"><!-- ... --></svg> <a class="text-blue group-hover:underline" href="#">Click me</a> </div>
Check out this CodePen to see it in action.
New
@variantsat-ruleTo make it easy to generate
hover,focus, andgroup-hoverversions of your own utilities, Tailwind 0.3 adds a new@variantsat-rule that lets you specify which variants to generate for a given list of classes:@variants hover, focus { .banana { color: yellow; } .chocolate { color: brown; } }This will generate the following CSS:
.banana { color: yellow; } .chocolate { color: brown; } .focus\:banana:focus { color: yellow; } .focus\:chocolate:focus { color: brown; } .hover\:banana:hover { color: yellow; } .hover\:chocolate:hover { color: brown; }The
@variantsat-rule supports all of the values that are supported in themodulessection of your config file:responsivehoverfocusgroup-hover
Note: In previous versions, Tailwind included undocumented
@hoverableand@focusabledirectives. These were fundamentally flawed in how they worked, and have been removed in favor of the new@variantsdirective.The
@responsivedirective however has not been removed, and we fully intend to continue to support it as a shortcut for@variants responsive {}.Customize the separator character
By default, Tailwind uses a colon (
:) as a separator between variants and utility names:<div class="hover:bg-blue">...</div>
Some templating languages (like Pug) don't play nicely with this, so Tailwind 0.3 adds a new configuration option that lets you change this if needed:
// ... module.exports = { // ... options: { // ... separator: '_', }, }Missing config keys now fallback to their default values
Prior to Tailwind 0.3, excluding a key (like
backgroundColors) from your config file was undefined behavior.To make upgrades smooth as new options are added to the config file, missing keys now fallback to their default values.
This has the added benefit of allowing you to completely omit keys from your config file if you don't intend to change the default values.
The exact behavior is as follows:
Top level keys fallback to their default values only if missing. The contents of top level keys are not merged, except for the two cases noted below.
The
moduleskey is merged with the default modules key. This means that if you exclude a module from your config, it will be generated using the default settings. It will not be disabled unless you include the key and set it tofalse.The
optionskey is merged with the default options key. This means if you only want to change one option, you only need to provide that one key.
New utilities
.pin-nonehas been added to undo existing.pin-{side}utilities at different breakpoints.resize-bothhas been added to allow resizing an element both horizontally and verticallyA completely new background attachment module has been added
A completely new background repeat module has been added
Completely new SVG fill and SVG stroke modules have been added
Upgrade Guide / Breaking Changes
Lists now have no margins by default
Impact: Medium
Until 0.3, Tailwind's Preflight base styles left
ulandolelements generally untouched, relying on thelist-resetutility to remove default browser styling if you wanted to use a list for navigation or similar.In 0.3, Tailwind still doesn't change
list-style-typeorpaddingon lists in our base styles, but we do remove margins:ul, ol { margin: 0; }Tailwind already did this for all headings, block quotes, paragraph tags, etc., so removing margins on lists feels much more consistent.
It's unlikely this will impact your project as you were most likely overriding the browser's default margins with existing margin utilities.
If you were relying on the browser's default list margins, simply add margin utilities to your lists to make up for the now missing default margin.
.pinno longer sets width and height to 100%Impact: Low
In an effort to make
.pin{-side?}utilities easier to undo at different breakpoints, the all-sides.pinutility no longer setswidthandheightto 100%.This will only affect you if you were using
.pinoniframe,textarea,input, orbuttonelements, and is easily remedied by adding thew-fullandh-fullutilities to those elements.SVG
fillno longer defaults tocurrentColorPrior to 0.3, Tailwind's Preflight styles set all SVG fills to
currentColor:svg { fill: currentColor; }This made it harder to use icon sets like Feather that are drawn entirely with strokes with Tailwind, because they'd now be filled with the current text color by default instead of having no fill.
Tailwind 0.3 removes this base style entirely, and adds the
fill-currentclass to make up for it, allowing you to be explicit when you want an SVG element to be filled with the current text color.There's two ways you can update your project for this change:
- Breaking
Simply re-add the base styles above to your own CSS.
- Breaking
Add the
fill-currentclass to any SVG elements that should be filled with the current text color.
- 0.2.x
0.2.2
19 Nov 2017Fix issue with dist files not being published due to bug in latest npm
0.2.0
17 Nov 2017- Breaking
If you have a custom config file, make sure your
0value border radius utility appears first in your border radius scale:{ // ... borderRadius: { + 'none': '0', 'sm': '.125rem', default: '.25rem', 'lg': '.5rem', 'full': '9999px', - 'none': '0', }, }This is important if you ever need to reset the border radius of a side at a breakpoint and add a border radius to another side that shares a corner.
- Breaking
Look for any time you round one side of an element in your codebase and collapse the separate position and size utilities into the new corresponding compound utility:
<!-- Change this: --> <div class="rounded-lg rounded-t"></div> <!-- To this: --> <div class="rounded-t-lg"></div> <!-- Change this: --> <div class="rounded rounded-l"></div> <!-- To this: --> <div class="rounded-l"></div>
- Breaking
If you were changing which side of an element was rounded responsively, now you'll need to explicitly unround one side when you round the other:
<!-- Change this: --> <div class="rounded-lg rounded-t lg:rounded-lg lg:rounded-l"></div> <!-- To this: --> <div class="rounded-t-lg lg:rounded-t-none lg:rounded-l-lg"></div>
New Features
Add a custom prefix to all utilities
One of the most common questions we've received since releasing v0.1.0 is "can I use Tailwind with {my existing CSS|another CSS framework}?"
While there was nothing stopping you from layering Tailwind on top of existing CSS, Tailwind has a lot of class names in common with other frameworks (
.container,.mb-2, etc.) so you could run into problematic naming collisions if you weren't careful.To fix this, you can now specify a custom prefix for all of the classes Tailwind generates under the new
optionskey in your Tailwind config file:{ // ... options: { prefix: 'tw-', // ... }, }Now all of Tailwind's utilities will include that prefix:
<!-- This... --> <div class="bg-white hover:bg-blue md:bg-red"></div> <!-- ... becomes this: --> <div class="tw-bg-white hover:tw-bg-blue md:tw-bg-red"></div>
To learn more, read the full documentation.
Optionally make all utilities
!importantAnother common obstacle when trying to use Tailwind with existing CSS is dealing with specificity.
By default, Tailwind utilities are not marked as
!important, which means that if your existing CSS has high specificity selectors, trying to override what those selectors are doing with a Tailwind utility just won't work.To fix this, we've added another option to the
optionssection of the Tailwind config file:{ // ... options: { // ... important: true, // ... }, }If you set
importanttotrue, all of Tailwind's declarations will get marked as!important, so they can easily be used to override existing CSS.To learn more, read the full documentation.
Round element corners independently
Up until now, you could only apply a border radius to pairs of corners, like the top two corners, left two corners, etc.
Now you can round corners independently too:
<!-- Round the top left corner: --> <div class="rounded-tl"></div> <!-- Round the top right corner: --> <div class="rounded-tr"></div> <!-- Round the bottom right corner: --> <div class="rounded-br"></div> <!-- Round the bottom left corner: --> <div class="rounded-bl"></div>
See more examples in the border radius documentation.
Cascading border colors and styles
In v0.1.x, our border width utilities used the
bordershorthand property, which meant that setting a border width also set a style and color:.border-2 { border: 2px solid config('colors.grey-lighter'); }This meant that if you wanted to change the border style or color of an element and then change the border width at a larger breakpoint, you'd have to re-specify the style/color:
<div class="border-2 border-red border-dashed md:border-4 md:border-red md:border-dashed"></div>
Now our border width utilities only specify the width, so any color or style modifications will properly cascade to larger breakpoints without having to be re-specified:
<div class="border-2 border-red border-dashed md:border-4"></div>
This is technically a breaking change, so check out the relevant section in the upgrade guide to understand how this might affect your site.
Upgrade Guide / Breaking Changes
autois no longer a hard-coded margin valueImpact: Low
Instead of hard-coding
mx-auto,ml-auto, etc. into Tailwind itself, we've moved those values into the customizable margin scale in the config file.So if you're using a custom config file, add
autoto your margin scale:{ // ... margin: { + 'auto': 'auto', 'px': '1px', '0': '0', '1': '0.25rem', '2': '0.5rem', '3': '0.75rem', '4': '1rem', '6': '1.5rem', '8': '2rem', }, }The
defaultConfigfunction is now a separate moduleImpact: Low
In the generated Tailwind config file, we include a line of code showing you how to reference Tailwind's default config values in case you'd like to reference them in your own config file.
For technical reasons, the way this works has changed:
// The old way: var defaultConfig = require('tailwindcss').defaultConfig() // The new way: var defaultConfig = require('tailwindcss/defaultConfig')()The good news is that this change makes it possible for you to import your custom config file into your front-end JavaScript if you'd like; making it easy to re-use the same color palette with libraries like D3.js or Chart.js for example.
Rounded utilities now combine position and radius size
Impact: High
Previously, border radius position and radius size were specified with two utilities. Now, size and position are combined into the same utility:
<!-- The old way: --> <div class="rounded-lg rounded-t"></div> <!-- The new way: --> <div class="rounded-t-lg"></div>
We made this change because it makes working with border radius generally more predictable and much more flexible.
For example, previously, if you wanted to round 3 corners of an element, you could try this, but it wouldn't work:
<!-- Doesn't work: --> <div class="rounded-lg rounded-t rounded-l"></div>
Instead, you'd see that only the left side was rounded. This is because the previous implementation of
rounded-lworked by unrounding the right-side corners.Now you can round 3 corners of an element two ways:
<!-- Option 1: Round two sides --> <div class="rounded-t-lg rounded-l-lg"></div> <!-- Option 3: Round the corners separately --> <div class="rounded-tl-lg rounded-tr-lg rounded-bl-lg"></div>
Upgrade steps
- Breaking
If you have a custom config file, make sure your
0value border radius utility appears first in your border radius scale:{ // ... borderRadius: { + 'none': '0', 'sm': '.125rem', default: '.25rem', 'lg': '.5rem', 'full': '9999px', - 'none': '0', }, }This is important if you ever need to reset the border radius of a side at a breakpoint and add a border radius to another side that shares a corner.
- Breaking
Look for any time you round one side of an element in your codebase and collapse the separate position and size utilities into the new corresponding compound utility:
<!-- Change this: --> <div class="rounded-lg rounded-t"></div> <!-- To this: --> <div class="rounded-t-lg"></div> <!-- Change this: --> <div class="rounded rounded-l"></div> <!-- To this: --> <div class="rounded-l"></div>
- Breaking
If you were changing which side of an element was rounded responsively, now you'll need to explicitly unround one side when you round the other:
<!-- Change this: --> <div class="rounded-lg rounded-t lg:rounded-lg lg:rounded-l"></div> <!-- To this: --> <div class="rounded-t-lg lg:rounded-t-none lg:rounded-l-lg"></div>
Border width utilities no longer affect border color/style
Impact: Medium
Previously, applying a border width utility like
.border-2would not only set the border width; it would also override the border color and border style.This is no longer the case, so if you were ever depending on that behavior (for example when overriding things responsively), you'll need to update your code to explicitly change the color and style:
<!-- Change this: --> <div class="border border-dashed border-red md:border-2"></div> <!-- To this: --> <div class="border border-dashed border-red md:border-2 md:border-solid md:border-grey-lighter"></div>
It's very unlikely that you were depending on this behavior so chances are you won't need to make this sort of change.
Instead, you'll probably notice this change from the opposite side, where you had to define your border color twice if you changed the size responsively.
Now you only need to define the color or style once, so although you don't have to remove the double definitions, they are now redundant and safe to remove:
<!-- Change this: --> <div class="border border-dashed border-red md:border-2 md:border-dashed md:border-red"></div> <!-- To this: --> <div class="border border-dashed border-red md:border-2"></div>
@applyis now very strict about what classes can be appliedImpact: Low
Previously,
@applywould only fail if it couldn't find a matching class to mixin. This led to unexpected behavior for a lot of people when trying to@applycomplex classes.So now instead of silently applying a class in a way that results in unexpected behavior,
@applybehaves much more strictly and will throw an explicit error if trying to@applysomething other than simple, un-nested, single definition classes.Here are the rules
@applynow enforces:- Breaking
You cannot
@applya class that is part of any ruleset which is nested within an at-rule.This means you can't
@applyclasses that are nested within media queries:@media (min-width: 300px) { .a { color: blue; } } .b { /* This will throw an error */ @apply .a; }This never worked before anyways, but now you'll get an error instead of wondering why your class didn't inherit the responsive behavior of the class you tried to apply.
- Breaking
You cannot
@applya class that contains a pseudo-selector..a:hover { color: red; } .b { /* This will throw an error */ @apply .a; }This never worked before either, but now the error message you get will be more helpful.
- Breaking
You cannot
@applya class that is included in multiple rulesets..a { color: red; } .b { /* This will throw an error */ @apply .a; } .a { color: blue; }This is what caused the confusion in #112. While supporting this wouldn't have negative consequences 95% of the time, it can be really confusing when it does cause problems.
@applyis meant for single stand-alone rulesets, so we don't see a reason to support this. If a class appears in multiple rulesets, it's a sign that something complex is happening, and@applyis not intended to be used to inherit complex behavior.
If your build fails because of
@applyin v0.2.0 but built successfully in v0.1.0, it's very likely something on your site wasn't actually working the way you expect.Add
optionskey to your configImpact: Low
If you'd like to use the new
prefixorimportantoptions, you'll want to add theoptionskey to the bottom of your config file.Here's what it looks like with the default values:
{ // ... options: { prefix: '', important: false, }, }This key is optional, so nothing will break if you don't add it.
Spacing, radius, and border width utility declaration order changes
Impact: Low
Previously, these utilities were declared purely based on the order in your scale, and with more specific declarations declared first.
For example, padding looked something like this:
.pt-0 { /* ... */ } .pr-0 { /* ... */ } .pb-0 { /* ... */ } .pl-0 { /* ... */ } .px-0 { /* ... */ } .py-0 { /* ... */ } .p-0 { /* ... */ } .pt-1 { /* ... */ } .pr-1 { /* ... */ } .pb-1 { /* ... */ } .pl-1 { /* ... */ } .px-1 { /* ... */ } .py-1 { /* ... */ } .p-1 { /* ... */ } .pt-2 { /* ... */ } .pr-2 { /* ... */ } .pb-2 { /* ... */ } .pl-2 { /* ... */ } .px-2 { /* ... */ } .py-2 { /* ... */ } .p-2 { /* ... */ }This meant that more general utilities like
p-2would override side-specific utilities likepl-1if the scale value in the general utility was higher:<!-- This markup: --> <div id="padded" class="p-4 px-2 pl-1"></div> <!-- ...is equivalent to this CSS: --> <style> #padded { padding-top: config('padding.4'); padding-bottom: config('padding.4'); padding-right: config('padding.4'); padding-left: config('padding.4'); } </style>Now, spacing, radius, and border width utilities are declared from most general to most specific, sorted by position first, then by the scale:
.p-0 { /* ... */ } .p-1 { /* ... */ } .p-2 { /* ... */ } .py-0 { /* ... */ } .px-0 { /* ... */ } .py-1 { /* ... */ } .px-1 { /* ... */ } .py-2 { /* ... */ } .px-2 { /* ... */ } .pt-0 { /* ... */ } .pr-0 { /* ... */ } .pb-0 { /* ... */ } .pl-0 { /* ... */ } .pt-1 { /* ... */ } .pr-1 { /* ... */ } .pb-1 { /* ... */ } .pl-1 { /* ... */ } .pt-2 { /* ... */ } .pr-2 { /* ... */ } .pb-2 { /* ... */ } .pl-2 { /* ... */ }This means that setting a left padding will override an
xpadding which will override an "all sides" padding:<!-- This markup: --> <div id="padded" class="p-4 px-2 pl-1"></div> <!-- ...is equivalent to this CSS: --> <style> #padded { padding-top: config('padding.4'); padding-bottom: config('padding.4'); padding-right: config('padding.2'); padding-left: config('padding.1'); } </style>It's very unlikely that this change will break your layout; it's more likely that you were working around this annoying behavior:
<!-- What you've probably written: --> <div class="pt-4 pr-4 pb-4 pl-2"></div> <!-- What you can write now: --> <div class="p-4 pl-2"></div>
- 0.1.x
0.1.6
9 Nov 2017Fix CDN files not being published to npm
0.1.5
8 Nov 2017Fix CLI tool not loading config files properly
Apply the same default placeholder styling that's applied to inputs to textareas
0.1.4
6 Nov 2017If using Webpack, it will now watch your config file changes
Autoprefix
distassets for quick hacking and prototypingMove list utilities earlier in stylesheet to allow overriding with spacing utilities (bug fix)
If using Webpack, it will now watch your config file changes
Autoprefix
distassets for quick hacking and prototypingMove list utilities earlier in stylesheet to allow overriding with spacing utilities (bug fix)
Add
my-auto,mt-auto, andmb-automargin utilitiesAdd
sans-serifto end of defaultsansfont stackWhen running
tailwind init [filename], automatically append.jsto filename if not presentSupport default fallback value in
config(...)function, ie.config('colors.blue', #0000ff)Don't output empty media queries if Tailwind processes a file that doesn't use Tailwind
0.1.3
2 Nov 2017Add new
.scrolling-touchand.scrolling-autoutilities for controlling inertial scroll behavior on WebKit touch devicesGenerate separate dist files for preflight, utilities, and tailwind for CDN usage
0.1.2
1 Nov 2017Fix issue with config option not being respected in
tailwind buildTarget Node 6.9.0 explicitly (instead of 8.6 implicitly) to support more users
0.1.1
1 Nov 2017Fix
tailwind buildCLI command not writing output files
0.1.0
1 Nov 2017Everything!
- 0.0.x
0.0.1
6 Oct 2017
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.