What Is New in Tailwind CSS 1.3
| Category | Highlights |
|---|---|
| New Features | space & divide utilities, transition-delay utilities, group-focus variant, default line-height per font-size, breakpoint-specific container padding, current color in palette, inline-grid, flow-root, clear-none |
How do I add consistent spacing or borders between sibling elements without extra markup?
Use the new space- and divide- utilities on the parent container.
space-x-4adds horizontal margin between children.space-y-4adds vertical margin between children.- Negative variants like
-space-x-2create overlapping effects. divide-xanddivide-yinsert 1 px borders between children, with color utilities such asdivide-blue-500.- Reverse utilities (
space-x-reverse,divide-y-reverse) handleflex-row-reverseorflex-col-reverselayouts.
<ul class="flex space-x-2">
<li>One</li>
<li>Two</li>
<li>Three</li>
</ul>
<ul class="divide-y divide-gray-200">
<li>Item A</li>
<li>Item B</li>
</ul>
How can I control transition delays directly in Tailwind?
Tailwind 1.3 adds delay-{amount} utilities for the transition-delay property.
- Values mirror the
durationscale (e.g.,delay-75,delay-1000). - Responsive variants are generated automatically.
<div class="transition ease-in-out duration-500 delay-200">
<!-- content -->
</div>
What new state variant lets me style children when a parent receives focus?
The group-focus variant works like group-hover but triggers on focus.
- Enable it in
variants.groupFocusof your config. - Useful for changing icons or inner text when the parent button is focused.
<button class="group text-gray-600 focus:bg-gray-100">
<svg class="h-5 w-5 text-gray-400 group-focus:text-gray-500"></svg>
Submit
</button>
How does Tailwind 1.3 simplify typography defaults and container padding?
You can now define a default line-height for each font-size and set breakpoint-specific padding for the container class.
- Font size with line-height:
md: ['16px','24px']generates.text-md { font-size:16px; line-height:24px; }. - Container padding example:
padding: { default:'1rem', sm:'2rem', lg:'4rem' }applies different horizontal padding at each breakpoint. - The palette now includes
currentforcurrentColor, simplifying border-color matching.
// tailwind.config.js
module.exports = {
theme: {
fontSize: {
sm: '12px',
md: ['16px', '24px'],
},
container: {
padding: {
default: '1rem',
sm: '2rem',
lg: '4rem',
xl: '5rem',
},
},
},
}
Which new display utilities are available for layout edge cases?
Tailwind 1.3 introduces inline-grid, flow-root, and clear-none utilities.
inline-gridsetsdisplay: inline-gridfor grid items that need to flow inline.flow-rootcreates a new block formatting context, eliminating margin-collapsing (a modern clearfix).clear-noneresets theclearproperty, useful with responsive utilities.
<span class="inline-grid grid-cols-3 gap-4">...</span>
<div class="flow-root">...</div>
<p class="clear-left md:clear-none">...</p>
Frequently Asked Questions
Does Tailwind 1.3 require any configuration changes to use space utilities?
No, space utilities work out of the box using the existing spacing scale.
Can I use negative space utilities to create overlapping elements?
Yes, prefix the utility with a minus sign, for example -space-x-2.
How do I enable the group-focus variant for background color?
Add groupFocus: ['responsive','focus'] to the variants section in tailwind.config.js.
What syntax defines a font size with a default line height?
In tailwind.config.js set fontSize: { md: ['16px','24px'] }.
How do I set different container paddings for sm and lg breakpoints?
Use container: { padding: { default: '1rem', sm: '2rem', lg: '4rem' } } in the config.
Which utility replaces the old clearfix hack?
The flow-root utility provides a modern clearfix alternative.