CSS Minimizer?

前端 未结 3 812
攒了一身酷
攒了一身酷 2020-12-29 12:01

Do you know of an online CSS compressor that helps remove redudant/ineffecient CSS declarations and replaces it with more optimized CSS?

Meaning, I know that a lot o

相关标签:
3条回答
  • 2020-12-29 12:36

    Clean CSS is one I tried before.

    However, for your example of merging rules I highly recommend doing it by hand, because there are situations where any automatic tool could mess something up or not catch an optimization.

    If you had, for example:

    border-top: 3px solid red; 
    border-bottom: 3px solid red; 
    border-right: 1px solid red; 
    border-left: 1px solid red;
    

    The best way to optimize this is:

    border-width: 3px 1px;
    border-style: solid;
    border-color: red;
    

    But an optimizer may not catch this.

    EDIT

    Tried the above example and Clean CSS didn't cut the mustard. However, FlumpCakes Optimizer is better. It catches your example, but not my advanced example.

    0 讨论(0)
  • 2020-12-29 12:37

    Try Devilo.us

    It also gives you control over how much you want to compress your code.

    0 讨论(0)
  • 2020-12-29 12:49

    Will this do? It beautifies, minifies, merges, and simplifies rules where possible, and is highly configurable.

    0 讨论(0)
提交回复
热议问题