用于解析和比较两个CSS样式表的工具 [英] Tool to parse and compare two CSS stylesheets

查看:203
本文介绍了用于解析和比较两个CSS样式表的工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道一个好的工具,可以解析和比较两个CSS样式表,以找到哪些选择器有不同的风格?

Does anyone know of a good tool that can parse and compare two CSS stylesheets in order to find which selectors have different styles?

我不能使用标准diff- like工具,因为两个CSS文件有非常不同的布局。我需要一个工具,可以解析和理解CSS,然后寻找实际上有两种样式表中不同样式的选择器。

I cannot use a standard diff-like tool because the two CSS files have very different layout. I need a tool that can parse and understand the CSS, then look for selectors that actually have different styles in the two stylesheets.

我发现的唯一工具是 Alan Hart的CSS Comparer ,但是它会在

The only tool I've found is the CSS Comparer from Alan Hart, however it gets confused when there are styles that apply to multiple selectors.

推荐答案

这是我最后做的,以防其他人有同样的问题:

Here's what I ended up doing, in case someone else has the same problem:


  1. 我使用 CSSTidy 规范化我想比较的两个样式表。在我的情况下的规范化意味着分裂多个选择器和排序选择器和属性。

  2. 在此之后,我使用了这里。 http://www.alanhart.co.uk/tools/compare-css.php\">来自Alan Hart的CSS Comparer工具,以了解两种样式表之间的差异。

  1. I used CSSTidy to "normalize" the two stylesheets I wanted to compare. Normalization in my case meant splitting multiple selectors and sorting selectors and properties. An online version of CSSTidy is available here.
  2. After this, I used the CSS Comparer tool from Alan Hart to find out differences between the two stylesheets.

这对我的具体要求做了。

This did the job for my specific requirements.

这篇关于用于解析和比较两个CSS样式表的工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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