Unused css - how do you clean it up?

后端 未结 2 1789
独厮守ぢ
独厮守ぢ 2021-01-31 04:53

Probably any experienced web developer would be familiar with this problem: over time your css files can grow pretty huge and ugly because of all the no longer used selectors, w

相关标签:
2条回答
  • 2021-01-31 05:13

    Dust Me Selecters and/or CSS Usage Firefox extensions can help you weed out unused CSS.

    In Chrome's Developer Tools you can use the Web Page Performance tool to find unused CSS rules.

    0 讨论(0)
  • 2021-01-31 05:28

    Check out uCSS library from Opera Software.

    It helps you to find unused CSS, as well as duplicate CSS. Also, you can get an overview of how many times each rule has been used in your markup. Several options are available by setting up a config file.

    Update:

    Another great alternative: csscss.

    Written in Ruby and supports SASS, Less.

    Update:

    Another great alternative: uncss.

    It works across multiple files and supports Javascript-injected CSS.

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