What Is New in Tailwind CSS 2.0
| Category | Highlights |
|---|---|
| New Features | All-new 220-color palette, native dark mode, 2XL breakpoint, outline ring utilities, @tailwindcss/forms plugin, extended text-overflow utilities |
| Improvements | Default line-heights per font size, extended spacing/typography/opacity scales, default transition duration & easing, variant extension syntax, group-hover & focus-within enabled by default |
| Breaking Changes | Renamed two utilities, removed three obsolete utilities, dropped IE11 support, require config tweaks for color module import |
| Deprecations | Old form plugin replaced by @tailwindcss/forms, legacy outline utilities removed |
How does Tailwind CSS 2.0 enable dark mode?
Tailwind CSS 2.0 adds native dark-mode support that can be toggled with the dark: prefix.
Set darkMode: "media" (or "class") in tailwind.config.js and then prefix any utility with dark: to apply it only when dark mode is active.
<div class="bg-white dark:bg-black">
<h1 class="text-gray-900 dark:text-white">Dark mode</h1>
<p class="text-gray-500 dark:text-gray-300">The feature you've all been waiting for.</p>
</div>
This works with hover, focus, and responsive variants as well.
What's new in the Tailwind CSS 2.0 color palette and how can I customize it?
Tailwind CSS 2.0 introduces a 22-color palette with ten shades each (50-900), giving you 220 colors out of the box.
The palette lives in the tailwindcss/colors module, so you can import it and replace or extend any color family in tailwind.config.js.
const colors = require('tailwindcss/colors')
module.exports = {
theme: {
colors: {
gray: colors.trueGray,
indigo: colors.indigo,
red: colors.rose,
yellow: colors.amber,
},
},
}
Use the new bg-gray-50 or text-indigo-600 utilities just like before, but now you have finer control over light and dark shades.
How have spacing, typography, and opacity scales been expanded in v2.0?
Tailwind CSS 2.0 adds micro-spacing values (e.g., 0.5, 1.5, 2.5, 3.5) and larger utilities (72, 80, 96) for padding, margin, inset, and translate.
- New typography sizes
7xl,8xl,9xlfor massive headlines. - Opacity scale now includes steps of 5 and 95, plus a
5value for ultra-transparent elements.
<span class="ml-0.5">Just a little nudge.</span>
<div class="p-96">This is too much padding.</div>
<h1 class="text-9xl font-bold">What is this, an Apple website?</h1>
<figure class="opacity-5">...</figure>
All inset and translate utilities now accept the full spacing scale, enabling precise positioning without custom CSS.
What are the new outline ring utilities and the official forms plugin?
Tailwind CSS 2.0 replaces the problematic outline property with ring utilities that render as box-shadows and respect border radius.
Use focus:ring-2 focus:ring-blue-300 focus:ring-opacity-50 to create a focus ring, and optionally add ring-offset-2 for a halo effect.
<button class="focus:ring-2 focus:ring-blue-300 focus:ring-opacity-50 focus:outline-none">Click me</button>
The new @tailwindcss/forms plugin normalizes form controls and makes them easy to style with utilities alone.
module.exports = {
plugins: [require('@tailwindcss/forms')],
}
After installing, a checkbox can be styled like class="h-4 w-4 rounded border-gray-300 text-indigo-500 focus:ring-2 focus:ring-indigo-200" without any custom CSS.
Frequently Asked Questions
Does upgrading to Tailwind CSS 2.0 require changes to existing class names?
Most class names stay the same; only two utilities were renamed and three were removed, so you may need to update those specific references.
How do I enable the 2XL breakpoint in my project?
The 2XL breakpoint is built-in at 1536px and can be used with the 2xl: prefix, for example 2xl:text-9xl.
Can I still use @apply with hover and focus variants in v2.0?
Yes, @apply now works with any variant, so you can write @apply hover:bg-black focus:ring-2 in your CSS.
Is IE11 support still available in Tailwind CSS 2.0?
No, Tailwind CSS 2.0 drops IE11 support, you must stay on v1.x if you need that browser.
How do I configure dark mode to use the class strategy instead of media?
Set darkMode: "class" in tailwind.config.js and then toggle a dark class on a parent element, for example dark:bg-gray-800.
Where can I find the new default transition duration setting?
The default transition duration is defined in theme.transitionDuration.DEFAULT and defaults to 150ms.