question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@-webkit-keyframes rule not being minified to one line

See original GitHub issue

An example CSS rule of:

@-webkit-keyframes bugfix {
    from { padding: 0 }
    to { padding: 0 }
}

Is processed via clean-css as:

@-webkit-keyframes bugfix{from{padding:0}
to{padding:0}
}

Ideally the whole rule should be all on the same line, I suspect its because of this being an at-rule and perhaps clean-css is seeing it as separate CSS properies, the syntax is weird. I use keepBreaks: true, which I think is where the problem is, but all other normal CSS rules are minified to a single line without any issue.

Equally, applying the rule above as a single line and then processing it with clean-css, causes it to be broken onto a new line, as noted in the example.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
jamesmacwhitecommented, Jan 14, 2017

@jakubpawlowicz This is really great work! I’ll definitely be implementing this into my email boilerplate project. I’ll do some experimenting, thanks for the new config options!

0reactions
jakubpawlowiczcommented, Jan 15, 2017

thanks @jamesmacwhite, 4.0 should be out soon!

Read more comments on GitHub >

github_iconTop Results From Across the Web

webkit keyframes breaks when minimized - Stack Overflow
Facing a weird issue; trying to create a spinner. when my css gets minified the format changes for the webkit ...
Read more >
0% steps in @keyframe animations incorrectly changed to 0 #80
The previously workaround do work, but they are working. Using CSS animations librairies is a nightmare, because you have to rewrite every-rules ......
Read more >
Animation - CSS-Tricks
Each animation needs to be defined with the @keyframes at-rule which is then called with the animation property, like so:
Read more >
keyframes - CSS: Cascading Style Sheets - MDN Web Docs
There is cascading within a @keyframes rule if multiple keyframes specify the same percentage values.
Read more >
How to Avoid CSS3 Animation Minification Muddles - SitePoint
Your production CSS should always be minified, right? However, beware of optimization behavior that could affect your lovely animations.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found