@@ -19,6 +19,19 @@ yarn add tailwindcss-animation
19
19
20
20
## Configuration
21
21
22
+ tailwind.config.js
23
+ ``` js
24
+ {
25
+ plugins: [
26
+ require (' tailwindcss-animation' ),
27
+ ],
28
+ }
29
+ ```
30
+
31
+ ## Extended configuration
32
+
33
+ Extending the properties is possible but not required due support for arbitrary values.
34
+
22
35
tailwind.config.js
23
36
``` js
24
37
{
@@ -31,105 +44,125 @@ tailwind.config.js
31
44
2000 : ' 2000ms' ,
32
45
},
33
46
animationIteration: {
34
- ' 10x ' : ' 10' ,
47
+ 10 : ' 10' ,
35
48
},
36
49
animationTiming: {
37
50
cubic: ' cubic-bezier(0, 0, 0.2, 1)' ,
38
51
},
39
52
},
40
53
},
41
- variants: {
42
- animationDelay: [' responsive' ],
43
- animationDuration: [' responsive' ],
44
- animationIteration: [' responsive' ],
45
- animationTiming: [' responsive' ],
46
- animationDirection: [' responsive' ],
47
- animationFillMode: [' responsive' ],
48
- animationPlayState: [' responsive' ],
49
- },
50
- plugins: [
51
- require (' tailwindcss-animation' ),
52
- ],
53
54
}
54
55
```
55
56
56
57
## Usage
57
58
58
59
``` html
59
- <div class =" animate-spin animation-duration-400 lg:animation-direction-reverse " ></div >
60
+ <div class =" w-10 h-10 bg-blue-500 animate-spin timing-ease-in-out-quint animation-delay-100 animation- duration-200 fillmode-forwards playstate-running direction-alternate lg:animation-duration-[1200ms] " ></div >
60
61
```
61
62
62
63
## Animation delay
63
64
64
- | Class | Properties |
65
- | -------------------- | ------------------------ |
66
- | animation-delay-none | animation-delay: 0ms; |
67
- | animation-delay-100 | animation-delay: 100ms; |
68
- | animation-delay-200 | animation-delay: 200ms; |
69
- | animation-delay-300 | animation-delay: 300ms; |
70
- | animation-delay-400 | animation-delay: 400ms; |
71
- | animation-delay-500 | animation-delay: 500ms; |
72
- | animation-delay-600 | animation-delay: 600ms; |
73
- | animation-delay-700 | animation-delay: 700ms; |
74
- | animation-delay-800 | animation-delay: 800ms; |
75
- | animation-delay-900 | animation-delay: 900ms; |
76
- | animation-delay-1000 | animation-delay: 1000ms; |
65
+ Long variant: animation-delay-% \
66
+ Short variant: n/a
67
+
68
+ | Class | Properties |
69
+ | ------------------------ | ------------------------ |
70
+ | animation-delay-none | animation-delay: 0ms; |
71
+ | animation-delay-100 | animation-delay: 100ms; |
72
+ | animation-delay-200 | animation-delay: 200ms; |
73
+ | animation-delay-300 | animation-delay: 300ms; |
74
+ | animation-delay-400 | animation-delay: 400ms; |
75
+ | animation-delay-500 | animation-delay: 500ms; |
76
+ | animation-delay-600 | animation-delay: 600ms; |
77
+ | animation-delay-700 | animation-delay: 700ms; |
78
+ | animation-delay-800 | animation-delay: 800ms; |
79
+ | animation-delay-900 | animation-delay: 900ms; |
80
+ | animation-delay-1000 | animation-delay: 1000ms; |
81
+ | animation-delay-[ 1500ms] | animation-delay: 1500ms; |
82
+ | animation-delay-[ 2s] | animation-delay: 2s; |
77
83
78
84
## Animation duration
79
85
80
- | Class | Properties |
81
- | ----------------------- | --------------------------- |
82
- | animation-duration-none | animation-duration: 0ms; |
83
- | animation-duration-100 | animation-duration: 100ms; |
84
- | animation-duration-200 | animation-duration: 200ms; |
85
- | animation-duration-300 | animation-duration: 300ms; |
86
- | animation-duration-400 | animation-duration: 400ms; |
87
- | animation-duration-500 | animation-duration: 500ms; |
88
- | animation-duration-600 | animation-duration: 600ms; |
89
- | animation-duration-700 | animation-duration: 700ms; |
90
- | animation-duration-800 | animation-duration: 800ms; |
91
- | animation-duration-900 | animation-duration: 900ms; |
92
- | animation-duration-1000 | animation-duration: 1000ms; |
86
+ Long variant: animation-duration-% \
87
+ Short variant: n/a
88
+
89
+ | Class | Properties |
90
+ | --------------------------- | --------------------------- |
91
+ | animation-duration-none | animation-duration: 0ms; |
92
+ | animation-duration-100 | animation-duration: 100ms; |
93
+ | animation-duration-200 | animation-duration: 200ms; |
94
+ | animation-duration-300 | animation-duration: 300ms; |
95
+ | animation-duration-400 | animation-duration: 400ms; |
96
+ | animation-duration-500 | animation-duration: 500ms; |
97
+ | animation-duration-600 | animation-duration: 600ms; |
98
+ | animation-duration-700 | animation-duration: 700ms; |
99
+ | animation-duration-800 | animation-duration: 800ms; |
100
+ | animation-duration-900 | animation-duration: 900ms; |
101
+ | animation-duration-1000 | animation-duration: 1000ms; |
102
+ | animation-duration-[ 1500ms] | animation-duration: 1500ms; |
103
+ | animation-duration-[ 2s] | animation-duration: 2s; |
93
104
94
105
## Animation iteration count
95
106
96
- | Class | Properties |
97
- | ---------------------------- | ------------------------------------ |
98
- | animation-iteration-none | animation-iteration-count: 0; |
99
- | animation-iteration-1x | animation-iteration-count: 1; |
100
- | animation-iteration-2x | animation-iteration-count: 2; |
101
- | animation-iteration-infinite | animation-iteration-count: infinite; |
107
+ Long variant: animation-iteration-% \
108
+ Short variant: iterate-%
109
+
110
+ | Class | Properties |
111
+ | ---------------- | ------------------------------------ |
112
+ | iterate-none | animation-iteration-count: 0; |
113
+ | iterate-1 | animation-iteration-count: 1; |
114
+ | iterate-2 | animation-iteration-count: 2; |
115
+ | iterate-[ 10] | animation-iteration-count: 10; |
116
+ | iterate-infinite | animation-iteration-count: infinite; |
102
117
103
118
## Animation timing function
104
119
105
- | Class | Properties |
106
- | ---------------------------- | --------------------------------------- |
107
- | animation-timing-ease | animation-timing-function: ease; |
108
- | animation-timing-ease-in | animation-timing-function: ease-in; |
109
- | animation-timing-ease-out | animation-timing-function: ease-out; |
110
- | animation-timing-ease-in-out | animation-timing-function: ease-in-out; |
120
+ Long variant: animation-timing-% \
121
+ Short variant: timing-%
122
+
123
+ | Class | Properties |
124
+ | ------------------------------------ | ----------------------------------------------------------- |
125
+ | timing-linear | animation-timing-function: linear; |
126
+ | timing-ease | animation-timing-function: ease; |
127
+ | timing-ease-in | animation-timing-function: ease-in; |
128
+ | timing-ease-out | animation-timing-function: ease-out; |
129
+ | timing-ease-in-out | animation-timing-function: ease-in-out; |
130
+ | timing-step-start | animation-timing-function: step-start; |
131
+ | timing-step-end | animation-timing-function: step-end; |
132
+ | timing-ease-in-out-back | animation-timing-function: cubic-bezier(.68,-.55,.265,1.55) |
133
+ | timing-[ cubic-bezier(0.1,0.7,1,0.1)] | animation-timing-function: cubic-bezier(0.1, 0.7, 1, 0.1); |
111
134
112
135
## Animation direction
113
136
114
- | Class | Properties |
115
- | ------------------------------------- | --------------------------------------- |
116
- | animation-direction-normal | animation-direction: normal; |
117
- | animation-direction-reverse | animation-direction: reverse; |
118
- | animation-direction-alternate | animation-direction: alternate; |
119
- | animation-direction-alternate-reverse | animation-direction: alternate-reverse; |
137
+ Long variant: animation-direction-% \
138
+ Short variant: direction-%
139
+
140
+ | Class | Properties |
141
+ | --------------------------- | --------------------------------------- |
142
+ | direction-normal | animation-direction: normal; |
143
+ | direction-reverse | animation-direction: reverse; |
144
+ | direction-alternate | animation-direction: alternate; |
145
+ | direction-alternate-reverse | animation-direction: alternate-reverse; |
120
146
121
147
## Animation fill mode
122
148
123
- | Class | Properties |
124
- | ------------------------ | ------------------------------- |
125
- | animation-fill-none | animation-fill-mode: none; |
126
- | animation-fill-forwards | animation-fill-mode: forwards; |
127
- | animation-fill-backwards | animation-fill-mode: backwards; |
128
- | animation-fill-both | animation-fill-mode: both; |
149
+ Long variant: animation-fill-% \
150
+ Short variant: fillmode-%
151
+
152
+ | Class | Properties |
153
+ | ------------------------- | ------------------------------------ |
154
+ | fillmode-none | animation-fill-mode: none; |
155
+ | fillmode-forwards | animation-fill-mode: forwards; |
156
+ | fillmode-backwards | animation-fill-mode: backwards; |
157
+ | fillmode-both | animation-fill-mode: both; |
158
+ | fillmode-[ none,backwards] | animation-fill-mode: none, backwards |
129
159
130
160
## Animation play state
131
161
132
- | Class | Properties |
133
- | ------------------------ | ------------------------------ |
134
- | animation-state-paused | animation-play-state: paused; |
135
- | animation-state-running | animation-play-state: running; |
162
+ Long variant: animation-state-% \
163
+ Short variant: playstate-%
164
+
165
+ | Class | Properties |
166
+ | ------------------ | ------------------------------ |
167
+ | playstate-paused | animation-play-state: paused; |
168
+ | playstate-running | animation-play-state: running; |
0 commit comments