Skip to content

fix: avoid parsing animation: "none" to animation: "none" none.#295

Merged
devongovett merged 2 commits intoparcel-bundler:masterfrom
yisibl:fix-animation-name-none
Sep 17, 2022
Merged

fix: avoid parsing animation: "none" to animation: "none" none.#295
devongovett merged 2 commits intoparcel-bundler:masterfrom
yisibl:fix-animation-name-none

Conversation

@yisibl
Copy link
Contributor

@yisibl yisibl commented Sep 17, 2022

In the animation property, special handling is required when the values of both animation-name and animation-fill-mode are none.

Input

.foo {
    animation: "none";
}

.bar {
  animation: "none" 2s;
}

Before

.foo {
  animation: "none" none;
}

.bar {
  animation: "none" 2s none;
}

After

.foo {
  animation-name: "none";
}

.bar {
  animation: "none" 2s;
}

In the `animation` property, special handling is required when the values of both `animation-name` and `animation-fill-mode` are `none`.
@yisibl yisibl force-pushed the fix-animation-name-none branch from e86db63 to c0cb736 Compare September 17, 2022 18:09
@devongovett devongovett merged commit 0732197 into parcel-bundler:master Sep 17, 2022
@devongovett
Copy link
Member

Thanks. I updated the logic slightly in df280dc and b6eec64, so that we serialize the name as a quoted string within the animation shorthand whenever it conflicts with a keyword from one of the other properties.

@yisibl yisibl deleted the fix-animation-name-none branch September 18, 2022 03:23
@yisibl
Copy link
Contributor Author

yisibl commented Sep 18, 2022

@devongovett Nice work, but what is the reason for serializing the animation-name to the end?

Also, we might want to consider browsers that don't support animation-name: <string>, like Chrome is implementing in: https://chromium-review.googlesource.com/c/chromium/src/+/3865188

@devongovett
Copy link
Member

Moving to the end fixed tests like this:

animation: 2s alternate reverse

In this case, alternate is the direction, and reverse is the name. Without quotes, it's ambiguous so order is important.

Hadn't considered that strings were a new syntax though. Might need to update this...

@devongovett
Copy link
Member

Updated: 6e47cdb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants