Skip to content

Keyframes from used animations with multiple keyframes are removed #166

Description

@ThisNameWasTaken

Describe the bug
Let's say we have the fallowing files:
styles.css

.scale-spin {
    animation: spin 300ms linear infinite forwards,scale 300ms linear infinite alternate;
}
@keyframes spin { /* ... */ }
@keyframes scale  { /* ... */ }

index.html

<div class="scale-spin"></div>

purgecss config

new Purgecss({
    content: ['index.html'],
    css: ['styles.css'],
    keyframes: true // discard unused keyframes
})

As of right now, if you run purgecss on these two, the scale keyframe will be removed and only the spin would be kept.

Expected behavior
Both the scale and spin keyframes are kept.

Desktop (please complete the following information):

  • OS: Windows 10
  • Version of Purgecss: 1.1.0

I will make a pull request to fix this issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions