Skip to content

fix: invalidate values starting with 'e' + digit #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2019

Conversation

PEsteves8
Copy link
Contributor

@PEsteves8 PEsteves8 commented May 29, 2019

Fixes #48

Prevents values starting with 'e' + digit from being considered numbers.

Currently, if the first character is an 'e' and it's followed by a digit, containsNumber will be set to true.

This results in values that aren't units at all, being processed as such. One such example is animation names which, after hashing can be broken.
The package cssnano/postcss-convert-values, runs this line using the return value from postcss-value-parse here https://github.com/cssnano/cssnano/blob/master/packages/postcss-convert-values/src/index.js#L26

An input of e6abc would be converted to NaNabc.

The issue causes animation bugs in which a rule like:

el {
  animation: e1abc 1s linear
}

would be converted to:

el {
  animation: NaNabc 1s linear
}

The animation name reference in the keyframes declaration would remain the original one, breaking the animation.

Prevents values starting with 'e' + digit from being considered numbers
@alexander-akait
Copy link
Collaborator

/cc @TrySound

@alexander-akait alexander-akait merged commit 7867d1f into TrySound:master May 30, 2019
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.

Values starting with letter 'e' and a digit
3 participants