@@ -170,6 +170,91 @@ const tests = [
170170 input : ".foo { animation-name: bar, foobar; }" ,
171171 expected : ":local(.foo) { animation-name: :local(bar), :local(foobar); }" ,
172172 } ,
173+ {
174+ name : "not localize revert" ,
175+ input : ".foo { animation: revert; }" ,
176+ expected : ":local(.foo) { animation: revert; }" ,
177+ } ,
178+ {
179+ name : "not localize revert #2" ,
180+ input : ".foo { animation-name: revert; }" ,
181+ expected : ":local(.foo) { animation-name: revert; }" ,
182+ } ,
183+ {
184+ name : "not localize revert #3" ,
185+ input : ".foo { animation-name: revert, foo, none; }" ,
186+ expected : ":local(.foo) { animation-name: revert, :local(foo), none; }" ,
187+ } ,
188+ {
189+ name : "not localize revert-layer" ,
190+ input : ".foo { animation: revert-layer; }" ,
191+ expected : ":local(.foo) { animation: revert-layer; }" ,
192+ } ,
193+ {
194+ name : "not localize revert" ,
195+ input : ".foo { animation-name: revert-layer; }" ,
196+ expected : ":local(.foo) { animation-name: revert-layer; }" ,
197+ } ,
198+ {
199+ name : "localize animation using special characters" ,
200+ input : ".foo { animation: \\@bounce; }" ,
201+ expected : ":local(.foo) { animation: :local(\\@bounce); }" ,
202+ } ,
203+ {
204+ name : "localize animation using special characters" ,
205+ input : ".foo { animation: bou\\@nce; }" ,
206+ expected : ":local(.foo) { animation: :local(bou\\@nce); }" ,
207+ } ,
208+ {
209+ name : "localize animation using special characters" ,
210+ input : ".foo { animation: \\ as; }" ,
211+ expected : ":local(.foo) { animation: :local(\\ as); }" ,
212+ } ,
213+ {
214+ name : "localize animation using special characters" ,
215+ input : ".foo { animation: t\\ t; }" ,
216+ expected : ":local(.foo) { animation: :local(t\\ t); }" ,
217+ } ,
218+ {
219+ name : "localize animation using special characters" ,
220+ input : ".foo { animation: -\\a; }" ,
221+ expected : ":local(.foo) { animation: :local(-\\a); }" ,
222+ } ,
223+ {
224+ name : "localize animation using special characters" ,
225+ input : ".foo { animation: --\\a; }" ,
226+ expected : ":local(.foo) { animation: :local(--\\a); }" ,
227+ } ,
228+ {
229+ name : "localize animation using special characters" ,
230+ input : ".foo { animation: \\a; }" ,
231+ expected : ":local(.foo) { animation: :local(\\a); }" ,
232+ } ,
233+ {
234+ name : "localize animation using special characters" ,
235+ input : ".foo { animation: -\\a; }" ,
236+ expected : ":local(.foo) { animation: :local(-\\a); }" ,
237+ } ,
238+ {
239+ name : "localize animation using special characters" ,
240+ input : ".foo { animation: --; }" ,
241+ expected : ":local(.foo) { animation: :local(--); }" ,
242+ } ,
243+ {
244+ name : "localize animation using special characters" ,
245+ input : ".foo { animation: 😃bounce😃; }" ,
246+ expected : ":local(.foo) { animation: :local(😃bounce😃); }" ,
247+ } ,
248+ {
249+ name : "not localize revert" ,
250+ input : ".foo { animation: --foo; }" ,
251+ expected : ":local(.foo) { animation: :local(--foo); }" ,
252+ } ,
253+ {
254+ name : "localize animation" ,
255+ input : ".foo { animation: a; }" ,
256+ expected : ":local(.foo) { animation: :local(a); }" ,
257+ } ,
173258 {
174259 name : "localize animation" ,
175260 input : ".foo { animation: bar 5s, foobar; }" ,
@@ -204,23 +289,20 @@ const tests = [
204289 expected : ":local(.foo) { animation: 1s :local(foo); }" ,
205290 } ,
206291 {
207- name :
208- "handle animations where the first value is not the animation name whilst also using keywords" ,
292+ name : "handle animations where the first value is not the animation name whilst also using keywords" ,
209293 input : ".foo { animation: 1s normal ease-out infinite foo; }" ,
210294 expected :
211295 ":local(.foo) { animation: 1s normal ease-out infinite :local(foo); }" ,
212296 } ,
213297 {
214- name :
215- "not treat animation curve as identifier of animation name even if it separated by comma" ,
298+ name : "not treat animation curve as identifier of animation name even if it separated by comma" ,
216299 input :
217300 ".foo { animation: slide-right 300ms forwards ease-out, fade-in 300ms forwards ease-out; }" ,
218301 expected :
219302 ":local(.foo) { animation: :local(slide-right) 300ms forwards ease-out, :local(fade-in) 300ms forwards ease-out; }" ,
220303 } ,
221304 {
222- name :
223- 'not treat "start" and "end" keywords in steps() function as identifiers' ,
305+ name : 'not treat "start" and "end" keywords in steps() function as identifiers' ,
224306 input : [
225307 ".foo { animation: spin 1s steps(12, end) infinite; }" ,
226308 ".foo { animation: spin 1s STEPS(12, start) infinite; }" ,
@@ -303,6 +385,18 @@ const tests = [
303385 expected :
304386 "@keyframes :local(foo) { from { color: red; } to { color: blue; } }" ,
305387 } ,
388+ {
389+ name : "localize keyframes starting with special characters" ,
390+ input : "@keyframes \\@foo { from { color: red; } to { color: blue; } }" ,
391+ expected :
392+ "@keyframes :local(\\@foo) { from { color: red; } to { color: blue; } }" ,
393+ } ,
394+ {
395+ name : "localize keyframes containing special characters" ,
396+ input : "@keyframes f\\@oo { from { color: red; } to { color: blue; } }" ,
397+ expected :
398+ "@keyframes :local(f\\@oo) { from { color: red; } to { color: blue; } }" ,
399+ } ,
306400 {
307401 name : "localize keyframes in global default mode" ,
308402 input : "@keyframes foo {}" ,
0 commit comments