Tailwind CSS Transition Timing Function
Last Updated :
29 Jul, 2024
Improve
This class accepts lots of value in tailwind CSS in which all the properties are covered in class form. The transition timing function class is used to specify the time an animation uses to change from one set of CSS transitions to another. In CSS, we have done that by using the CSS transition-timing-function.
Transition timing function classes:
- ease-linear: In this, the animation has the same speed from start to end.
- ease-in: This is similar to easing where the end of the animation is fast.
- ease-out: This is similar to easing where the start of the animation is fast.
- ease-in-out: This sets the class to its default value.
Syntax:
<element class="ease-{timing}">...</element>
Example:
<!DOCTYPE html>
<html>
<head>
<link href=
"https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"
rel="stylesheet">
</head>
<body class="text-center mx-4 space-y-2">
<h1 class="text-green-600 text-5xl font-bold">
GeeksforGeeks
</h1>
<b>Tailwind CSS Transition Timing Function Class</b>
<div class="bg-green-200 m-8 grid grid-flow-col gap-4 p-5">
<button class="transition duration-700 ease-in
bg-green-300 hover:bg-green-600 transform
hover:-translate-y-1 hover:scale-110
rounded-lg p-4 border border-green-900">
Hover me for ease-in
</button>
<button class="transition duration-700 ease-out
bg-green-300 hover:bg-green-600 transform
hover:-translate-y-1 hover:scale-110
rounded-lg p-4 border border-green-900">
Hover me for ease-out
</button>
<button class="transition duration-700 ease-in-out
bg-green-300 hover:bg-green-600 transform
hover:-translate-y-1 hover:scale-110
rounded-lg p-4 border border-green-900">
Hover me for ease-in-out
</button>
<button class="transition duration-700 ease-linear
bg-green-300 hover:bg-green-600 transform
hover:-translate-y-1 hover:scale-110
rounded-lg p-4 border border-green-900">
Hover me for ease-linear
</button>
</div>
</body>
</html>
41
1
2
<html>
3
<head>
4
<link href=
5
"https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"
6
rel="stylesheet">
7
</head>
8
9
<body class="text-center mx-4 space-y-2">
10
<h1 class="text-green-600 text-5xl font-bold">
11
GeeksforGeeks
12
</h1>
13
<b>Tailwind CSS Transition Timing Function Class</b>
14
<div class="bg-green-200 m-8 grid grid-flow-col gap-4 p-5">
15
<button class="transition duration-700 ease-in
16
bg-green-300 hover:bg-green-600 transform
17
hover:-translate-y-1 hover:scale-110
18
rounded-lg p-4 border border-green-900">
19
Hover me for ease-in
20
</button>
21
<button class="transition duration-700 ease-out
22
bg-green-300 hover:bg-green-600 transform
23
hover:-translate-y-1 hover:scale-110
24
rounded-lg p-4 border border-green-900">
25
Hover me for ease-out
26
</button>
27
<button class="transition duration-700 ease-in-out
28
bg-green-300 hover:bg-green-600 transform
29
hover:-translate-y-1 hover:scale-110
30
rounded-lg p-4 border border-green-900">
31
Hover me for ease-in-out
32
</button>
33
<button class="transition duration-700 ease-linear
34
bg-green-300 hover:bg-green-600 transform
35
hover:-translate-y-1 hover:scale-110
36
rounded-lg p-4 border border-green-900">
37
Hover me for ease-linear
38
</button>
39
</div>
40
</body>
41
</html>
Output:
Video Player
00:00
00:00