Skip to content
This repository has been archived by the owner on Jun 18, 2023. It is now read-only.

Percent Sign is Stripped From Keyframes Causing Them to Fail #68

Open
LiterallyDoge opened this issue Aug 31, 2018 · 1 comment
Open

Comments

@LiterallyDoge
Copy link

Hi and thanks for this plugin.

If you define:

@keyframes fancy-mouse-breathing-animation {
	0% {
		background-color: rgba(0,255,0, 1);
	}

	50% {	
		background-color: rgba(0,255,0, 0.33);
	}

	100% {
		background-color: rgba(0,255,0, 1);
	}
}

And then run uglifyCSS, the % symbol will be omitted from the output on 0 (probably because you are assuming that all 0's are 0 and the percentage is superfluous - which in this case it is not, because it is acting as a keyword and not a value), causing Chrome to fail to see it as a valid state, and the animation will "crash."

Is this fixable?

@fabd
Copy link

fabd commented Sep 21, 2018

Yeah this is a known bug with yuicompressor. Ran across this recently with background-color:hsla(0,0%,100%,.9);which gets minfiied to (0,0,100%,.9), which actually causes the css property to fail applying (a bit silly to be fair the browser should just accept 0, if only for shortening purposes, but that's beside the pt).

So I was looking for an alternative. I found this, but you just confirm my hunch.. . a port of yuicompressor will have the same issues. So the solution afaik, is to simply not use yuicompressor anymore.

For fmarcia fyi the bug in question is fixed on master of the yuicompressor repo.. (cf. link above).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants