gruntjs / grunt-contrib-cssmin

Compress CSS files.
http://gruntjs.com/
MIT License
793 stars 147 forks source link

Some properties getting dropped on minification #230

Closed koolkatwebdesigns closed 9 years ago

koolkatwebdesigns commented 9 years ago

In my CSS I have: .site-title { font-family: "SnellRoundhandW01-Scrip", cursive; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

The resulting minified file has: site-title{font-family:SnellRoundhandW01-Scrip,cursive}

matthew-gerstman commented 9 years ago

+1

markmiro commented 9 years ago

I've run into a similar issue. Not sure if it's a separate bug.

.a { display:-webkit-flex }
.a { display:flex }

Becomes:

.a{display:flex}

It looks like it will just use the last one that it believes is equivalent.

.a { display:flex }
.a { display:-webkit-flex }

Becomes:

.a{display:-webkit-flex}
efender commented 9 years ago

Same problem.

Normal:

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  background: #379BE6;
  color: #FFF;
}

after cssmin:

.sidebar {
  position: fixed;
  top: 0;
}

css files - https://dropmefiles.com/D1SLx (before & after)

As I see this issue because of over optimization. Can I turn off this optimization?

efender commented 9 years ago

This option fixes this issue:

options: {
    restructuring: false
},

Full list of options here - https://github.com/jakubpawlowicz/clean-css#how-to-use-clean-css-programmatically

shawnwang5 commented 9 years ago

Normal: .iLoading_showbox { min-height:90px; width:100px; position: fixed; left:50%; top:45%; margin-top:-50px; margin-left:-55px; background:rgba(0,0,0,0.5); z-index:120000; text-align:center; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; display: none; padding: 5px 5px; }

after cssmin: .iLoading_showbox { min-height: 90px; width: 100px; left: 50%; margin-top: -50px; margin-left: -55px; z-index: 120000; text-align: center; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px; padding: 5px }

After cssmin,top property is removed, my page out of whack.

XhmikosR commented 9 years ago

You should report such issues upstream if they are still present.