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

at-media + at-keyframes not minified correctly #23

Open
firewizard opened this issue Oct 31, 2016 · 5 comments
Open

at-media + at-keyframes not minified correctly #23

firewizard opened this issue Oct 31, 2016 · 5 comments

Comments

@firewizard
Copy link

Minifier break css when at-media & at-keyframes are used together.

This css:

@media (min-width: 0) and (max-width: 360px) {
    @keyframes loop {
        0% {
            transform: translateX(0);
        }
        100% {
            transform: translateX(calc(-100% + 360px));
        }
    }
}

@media (min-width: 480px) {
    @keyframes loop {
        0% {
            transform: translateX(0);
        }
        100% {
            transform: translateX(calc(-100% + 480px));
        }
    }
}

.a {
    color: red
}

when minified and then re-formatted, produces this result:

@media (min-width: 0) and (max-width: 360px) {
    @keyframes loop {
        0% {
            transform: translateX(0)
        }
        100% {
            transform: translateX(calc(-100% + 360px))
        }
    }@media (min-width: 480px) {
    @keyframes loop {
        0% {
            transform: translateX(0)
        }
        100% {
            transform: translateX(calc(-100% + 480px))
        }
    }
} .a {
      color: red
  }

Notice the missing "}". If there's only one at-media + at-keyframes block, it works well, if there are more, it breaks all of them except the last one.

@natxet
Copy link
Owner

natxet commented Oct 31, 2016

Hi firewizard, can you make a pull request to fix this issue please?
Thanks!

@firewizard
Copy link
Author

That's the problem, I wasn't able to figure out a fix for this,
otherwise I would've opened a PR instead of an issue.

@natxet
Copy link
Owner

natxet commented Oct 31, 2016

;-) Sorry, I'm just maintaining this repo, I wish I could help, lets see if someone can figure it out!

@yess-webioza
Copy link

same problem with @supports block

@supports (-ms-overflow-style: none) { .ps { overflow: auto !important; } }

produces:

@supports (-ms-overflow-style: none){.ps { overflow:auto !important}

there's missing last curly bracket

@Ruud-Zuiderlicht
Copy link

Also see #29

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

No branches or pull requests

4 participants