Skip to content

Fix longhands of the animation and transition shorthands - #284

Merged
eXpl0it3r merged 1 commit into
masterfrom
fix/animation-transition-shorthands
Nov 10, 2026
Merged

eXpl0it3r merged 1 commit into
masterfrom
fix/animation-transition-shorthands

Conversation

@eXpl0it3r

Copy link
Copy Markdown
Collaborator

The animation and transition shorthands expanded into the wrong longhands. With animation: slide 1s, the 1s ended up in animation-duration and animation-delay, and animation-name was reset to initial. As soon as a value had two times, e.g. transition: 1s 2s or animation: slide 1s ease-in 2s infinite alternate both paused, every longhand fell back to initial. transition: none was rejected as a whole.

TimeBasedShorthandConverter consumed the time values with the plain TimeConverter instead of the slot's converter, so the value wasn't bound to its longhand and got handed to every longhand of the shorthand. The time is now consumed through the converter of its slot, so the first time goes to the duration and the second one to the delay, and the other components keep their value. Additionally, the transition shorthand accepts none as property, but only if the list has a single item, as css-transitions-1 says.

How to test this PR?

CI should succeed. The following tests cover the expansion and fail on master:

  • AnimationShorthandSetsEveryLonghand
  • AnimationShorthandWithOneTimeSetsOnlyTheDuration
  • AnimationShorthandGivesKeywordsToTheOtherLonghandsFirst
  • AnimationShorthandListSetsTheLonghandsPerItem
  • CssTransitionShorthandWithOneTimeSetsOnlyTheDuration
  • CssTransitionShorthandAssignsTheSecondTimeToTheDelay
  • CssTransitionShorthandNoneSetsThePropertyToNone

CssTransitionShorthandWithNoneInAListIsInvalid makes sure transition: none, color 1s stays invalid.

@eXpl0it3r
eXpl0it3r force-pushed the fix/animation-transition-shorthands branch from ad1062c to a03486b Compare November 10, 2026 19:06
@eXpl0it3r
eXpl0it3r merged commit c83eed4 into master Nov 10, 2026
18 checks passed
@eXpl0it3r
eXpl0it3r deleted the fix/animation-transition-shorthands branch November 10, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant