Skip to content

Commit

Permalink
fix(preset-wind): wrong output for animate-iteration-count (#2721)
Browse files Browse the repository at this point in the history
  • Loading branch information
enpitsuLin committed Jun 5, 2023
1 parent 12ab4d3 commit d45bcb9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/preset-wind/src/rules/animation.ts
Expand Up @@ -62,7 +62,7 @@ export const animations: Rule<Theme>[] = [
],

// others
[/^animate-(?:iteration-|count-|iteration-count-)(.+)$/, ([, d]) => ({ 'animation-iteration-count': h.bracket.cssvar(d) ?? d.replace(/\-/g, ',') }), { autocomplete: ['animate-(iteration|count|iteration-count)', 'animate-(iteration|count|iteration-count)-<num>'] }],
[/^animate-(?:iteration-count-|iteration-|count-)(.+)$/, ([, d]) => ({ 'animation-iteration-count': h.bracket.cssvar(d) ?? d.replace(/\-/g, ',') }), { autocomplete: ['animate-(iteration|count|iteration-count)', 'animate-(iteration|count|iteration-count)-<num>'] }],
[/^animate-(play-state-|play-|state-)?(.+)$/,
([, t, d]) => ['paused', 'running', ...[t ? globalKeywords : []]].includes(d) ? { 'animation-play-state': d } : undefined,
{
Expand Down
10 changes: 5 additions & 5 deletions test/__snapshots__/postcss.test.ts.snap
Expand Up @@ -104,11 +104,11 @@ exports[`postcss > @unocss 1`] = `
.animate-normal{animation-direction:normal;}
.animate-reverse{animation-direction:reverse;}
.animate-count-2\\\\.4{animation-iteration-count:2.4;}
.animate-iteration-2{animation-iteration-count:2;}
.animate-iteration-count-\\\\[2\\\\,4\\\\,infinity\\\\]{animation-iteration-count:count,[2,4,infinity];}
.animate-iteration-count-\\\\$variable{animation-iteration-count:count,$variable;}
.animate-iteration-count-2{animation-iteration-count:count,2;}
.animate-iteration-count-2-4-infinity{animation-iteration-count:count,2,4,infinity;}
.animate-iteration-2,
.animate-iteration-count-2{animation-iteration-count:2;}
.animate-iteration-count-\\\\[2\\\\,4\\\\,infinity\\\\],
.animate-iteration-count-2-4-infinity{animation-iteration-count:2,4,infinity;}
.animate-iteration-count-\\\\$variable{animation-iteration-count:var(--variable);}
.animate-paused,
.animate-play-paused{animation-play-state:paused;}
.animate-play-state-running,
Expand Down
10 changes: 5 additions & 5 deletions test/assets/output/preset-wind-targets.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d45bcb9

Please sign in to comment.