[Announcement] Tailwind CSS v1.3 is out! #1617
Replies: 8 comments
-
|
Awesome! Just the other day I wrote an |
Beta Was this translation helpful? Give feedback.
-
|
Great! The new |
Beta Was this translation helpful? Give feedback.
-
|
I've always avoided |
Beta Was this translation helpful? Give feedback.
-
|
Woo hoo! Very stoked about the new space and divide utilities |
Beta Was this translation helpful? Give feedback.
-
|
I wasn't aware of the PR and discussions of These are the only utilities that are doing direction specific action without stating it in their names. This is the reason It breaks the built-in support for RTL tailwind had. my suggestion is to substitute the x with specific direction r and l |
Beta Was this translation helpful? Give feedback.
-
|
@20lives Would it solve the problem if I patched them to use CSS logical properties instead? Like |
Beta Was this translation helpful? Give feedback.
-
|
@adamwathan thank you for your response, |
Beta Was this translation helpful? Give feedback.
-
|
Just stopping by to say thanks! |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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 🚀
There's no breaking changes, so to upgrade all you need to do is run:
New Features
spaceanddividelayout utilitiestransition-delayutilitiesgroup-focusvariantcontainerclasscurrentto the default color paletteinline-gridutilityflow-rootdisplay utilityclear-noneutilityNew
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:
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: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: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: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: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:There are a couple limitations of our implementation that are worth pointing out:
orderpropertyDespite 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:We include the same values we do for the
duration-{amount}utilities and generateresponsivevariants by default: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:
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]: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: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 v1.3 enhances this functionality to allow you to specify a different amount of padding for each breakpoint:
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: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.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!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.Only two people noticed it was documented but missing, so odds are you don't even care that we added this.
Beta Was this translation helpful? Give feedback.
All reactions