Skip to content
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

Remove duplicate keyframe declarations #202

Closed
yocontra opened this issue Jun 7, 2014 · 4 comments
Closed

Remove duplicate keyframe declarations #202

yocontra opened this issue Jun 7, 2014 · 4 comments

Comments

@yocontra
Copy link

yocontra commented Jun 7, 2014

Some css pre-processors don't have a way to import keyframes only once so you end up with duplicates all over the place.

Related: https://github.com/LearnBoost/stylus/issues/1579

@peterbe
Copy link
Contributor

peterbe commented Sep 7, 2017

Yep. Consider:

let css = `
@keyframes progress-bar-stripes {
    0% {
        background-position: 40px 0
    }
    to {
        background-position: 0 0
    }
}
@keyframes progress-bar-stripes {
    0% {
        background-position: 40px 0
    }
    to {
        background-position: 0 0
    }
}
`
const minifiedCss = csso.minify(css).css
console.log(minifiedCss);

This yields

@keyframes progress-bar-stripes{0%{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{0%{background-position:40px 0}to{background-position:0 0}}

@peterbe
Copy link
Contributor

peterbe commented Sep 7, 2017

Actually, in this commit it does say
"remove duplicate (with the same name) keyframes (keep last one)".

So once that feature is released, we can close this. Right?

@lahmatiy
Copy link
Member

lahmatiy commented Sep 7, 2017

Yes, you're right. Thank you for pointing on this issue.

@lahmatiy
Copy link
Member

v3.2.0 fixed the issue.

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

No branches or pull requests

3 participants