Latest in branch 1.5
1.5.2
Released 21 Jul 2020
(5 years ago)
SoftwareTailwind CSS
Branch1.5
Initial release1.5.0
15 Jul 2020
(5 years ago)
Latest release1.5.2
21 Jul 2020
(5 years ago)
Support status28 Jul 2020
(Ended 5 years, 9 months ago)
Release noteshttps://github.com/tailwindlabs/tailwindcss/releases/tag/v1.5.2
Source codehttps://github.com/tailwindlabs/tailwindcss/tree/v1.5.2
Downloadhttps://github.com/tailwindlabs/tailwindcss/releases/tag/v1.5.2
Tailwind CSS 1.5 ReleasesView full list

What Is New in Tailwind CSS 1.5

Category Highlights
New Features Component variants support, responsive container variants, focus-visible variant, checked variant
Breaking Changes One accidental breaking change introduced; fixed in v1.5.1

How do I enable variants for component classes in Tailwind CSS 1.5?

You can now generate responsive and other variants for component classes using the new variants option in the plugin API or the @layer directive.

  • When adding components via addComponents, pass a second argument with variants: ['responsive'] (or any other variant you need).
  • Alternatively, use the array shorthand: addComponents({'.card': {/* ... */}}, ['responsive']).
  • For plain CSS, wrap your component rules in @layer components and @responsive to let Tailwind purge correctly.
plugin(function ({ addComponents }) {
  addComponents({
    '.card': {
      /* component styles */
    }
  }, {
    variants: ['responsive']
  })
})

Can the container utility be responsive in Tailwind CSS 1.5?

Yes, the container class now supports responsive variants out of the box.

  • Apply md:container to lock the container width only at medium breakpoints and above.
  • Additional variants such as focus or group-hover can be enabled via the variants.container array in tailwind.config.js.
<div class="md:container">
  <!-- content -->
</div>

What is the new focus-visible variant and when should I use it?

The focus-visible variant lets you apply styles only when an element receives focus via keyboard navigation, keeping mouse interactions untouched.

  • Enable it by adding focus-visible to the desired utilities in the variants section of tailwind.config.js.
  • Typical use case: focus-visible:outline-none focus-visible:shadow-outline on buttons.
  • Browser support is still limited; consider the WICG focus-visible polyfill or the postcss-focus-visible plugin for broader coverage.
<button class="focus-visible:outline-none focus-visible:shadow-outline">
  Click me
</button>

How can I style checked form controls with Tailwind CSS 1.5?

The new checked variant enables conditional styling of checkboxes and radio buttons.

  • Add checked to the utilities you want to respond to the :checked pseudo-class.
  • Enable it in tailwind.config.js under the appropriate utility's variants array.
  • Example: bg-white checked:bg-blue-500 changes the background when the input is checked.
<input type="checkbox" class="bg-white checked:bg-blue-500" />

Frequently Asked Questions

Do I need to modify my plugin code to use component variants in Tailwind CSS 1.5?
You add the variant by passing ['responsive'] as the second argument to addComponents or by using @layer components with @responsive.

How do I enable the focus-visible variant globally?
Add focus-visible to the desired utilities in the variants section of tailwind.config.js.

Can I combine responsive and checked variants on the same class?
Yes, you can chain them like md:checked:bg-blue-500.

Is the responsive container variant enabled by default?
Yes, responsive variants for container are on by default.

What breaking change should I be aware of when upgrading to 1.5?
An accidental breaking change was introduced and fixed in v1.5.1, so upgrade to 1.5.1 to avoid issues.

Do I need a polyfill for the focus-visible variant?
Browser support is limited, so using the WICG focus-visible polyfill or postcss-focus-visible plugin is recommended.

Releases In Branch 1.5

VersionRelease date
1.5.221 Jul 2020
(5 years ago)
1.5.115 Jul 2020
(5 years ago)
1.5.015 Jul 2020
(5 years ago)