Utilities for controlling the easing of CSS transitions.
<button class="transition ease-in duration-700 ...">Hover me</button>
<button class="transition ease-out duration-700 ...">Hover me</button>
<button class="transition ease-in-out duration-700 ...">Hover me</button>
To control an element's transition-timing-function at a specific breakpoint, add a {screen}:
prefix to any existing transition-timing-function utility. For example, use md:ease-in-out
to apply the ease-in-out
utility at only medium screen sizes and above.
For more information about Tailwind's responsive design features, check out the Responsive Design documentation.
By default, Tailwind provides four general purpose transition-timing-function utilities. You change, add, or remove these by customizing the transitionTimingFunction
section of your Tailwind theme config.
// tailwind.config.js
module.exports = {
theme: {
extend: {
transitionTimingFunction: {
+ 'in-expo': 'cubic-bezier(0.95, 0.05, 0.795, 0.035)',
+ 'out-expo': 'cubic-bezier(0.19, 1, 0.22, 1)',
}
}
}
}
Learn more about customizing the default theme in the theme customization documentation.
By default, only responsive variants are generated for transition-timing-function utilities.
You can control which variants are generated for the transition-timing-function utilities by modifying the transitionTimingFunction
property in the variants
section of your tailwind.config.js
file.
For example, this config will also generate hover and focus variants:
// tailwind.config.js
module.exports = {
variants: {
extend: {
// ...
+ transitionTimingFunction: ['hover', 'focus'],
}
}
}
If you don't plan to use the transition-timing-function utilities in your project, you can disable them entirely by setting the transitionTimingFunction
property to false
in the corePlugins
section of your config file:
// tailwind.config.js
module.exports = {
corePlugins: {
// ...
+ transitionTimingFunction: false,
}
}