Extracting only the css used in a specific page

前端 未结 15 2046
难免孤独
难免孤独 2020-12-04 06:51

Say you had a dynamically generated site that has been worked on by too many people, past and present, and you now have a collection of shared stylesheets that contain over

15条回答
  •  被撕碎了的回忆
    2020-12-04 07:36

    I came across Uncss-Online - Unofficial server, very convenient for testing or one-off usage! I think its the best tool I've come across.

    UnCSS is a tool that removes unused CSS from your stylesheets. It works across multiple files and supports Javascript-injected CSS. It can be used in this way:

    • Copy & paste your HTML and CSS into provided boxes
    • Click button
    • Wait for magic to happen
    • Unused CSS is gone, take the rest and use it!

    You can check their Github Page for other advanced ways to use this tool

提交回复
热议问题