仅提取特定页面中使用的css [英] Extracting only the css used in a specific page

查看:113
本文介绍了仅提取特定页面中使用的css的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设您有一个动态产生的网站,由太多的人(过去和现在)处理过,现在您拥有一组包含超过20,000行CSS的共享样式表。它没有组织,有一些类和基于id的选择器,但也有太多的基于标签的选择器。然后说你有100个模板,通过一些控制器使用这些样式。

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 20,000 lines of CSS. It isn't organized at all, there are some class and id-based selectors but also way too many tag-based selectors. And then say you have 100 templates that use these styles, via some controller.

有一个工具,一些工作就像Firebug也许,你可以指向一个url并且它将确定该页面的所有适用的CSS选择器并将它们转储到文件?

Is there a tool, something that works like Firebug perhaps, that you can point at a url and it would determine all of the applicable CSS selectors for that page and dump them to a file? Basically some way to rip apart the shared stylesheets on a page by page basis.

推荐答案

我之前使用过Dust-Me选择器,这是一个Firefox插件。这是非常容易使用和多才多艺,因为它维护一个组合列表跨越多个页面使用的CSS值。

I've used Dust-Me Selectors before, which is a Firefox plugin. It's very easy to use and versatile as it maintains a combined list across a number of pages of which CSS values are used.

缺点是,我不能自动化它来蜘蛛整个网站,所以我最终使用它只在我的网站的关键网​​页/温度。这是非常有用的。

The downside is that I wasn't able to automate it to spider an entire site, so I ended up using it just on key pages/tempates of my site. It is very useful nonetheless.

http://www.sitepoint.com/灰尘收集器/

https://addons.mozilla.org/en-US/firefox/addon/dust-me-selectors/

与上述评论相反Dust-Me Selectors 2.2与Firefox 3.6(我刚刚安装了它)兼容。

Contrary to the comment above Dust-Me Selectors 2.2 is compatible with Firefox 3.6 (I've just installed it).

这篇关于仅提取特定页面中使用的css的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆