Commit 749f362
fix(web): register token-backed duration and easing scales with tailwind-merge
tailwind.config.js defines transitionDuration (fast|normal|slow) and
transitionTimingFunction (standard|accelerate|decelerate) as CSS-var-backed
custom keys. twMerge's built-in `duration` and `ease` groups only recognise
numeric/known values, so these fell through as unrecognised classes and were
never de-duplicated:
cn('duration-fast', 'duration-normal') => "duration-fast duration-normal"
cn('ease-standard', 'ease-linear') => "ease-standard ease-linear"
Both classes survived and CSS source order silently decided the winner, so a
component prop could not reliably override a base motion class. Register both
scales in extendTailwindMerge so they resolve last-wins like every other group.
Adds an it.each regression block covering both scales in each direction
(13 -> 21 tests) to lock the behaviour, since the failure mode is invisible
in review and only shows up as a subtly wrong animation speed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 1d32a78 commit 749f362
2 files changed
Lines changed: 29 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
91 | 114 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| |||
0 commit comments