CSS自动合并两个相似的文件

时间:2017-04-28 12:14:20

标签: css merge sass duplicates

我会喜欢处理2个大(7k +行)CSS文件的建议。我想最终重构这些,但在此之前我想合并这两个。

他们不是彼此的副本,但是如果两者都插入的话,它们都会与许多重复的代码非常相似。

是否有一种快速方法可以立即合并这两个文件,以生成一个包含所有单个CSS的连接文件。

例如合并文件1

.Duplicate-class-1 {
    background: red;
    width: 100px;
    height: 100px;
}
 .Duplicate-class-2 {
    background: blue;
    width: 100px;
    height: 100px;
}
.Unique-class-1{
    background: purple;
    width: 100px;
    height: 100px;
}

使用文件2

.Duplicate-class-1 {
    background: red;
    width: 100px;
    height: 100px;
}
 .Duplicate-class-2 {
    background: blue;
    width: 100px;
    height: 100px;
}
.Unique-class-2{
    background: green;
    width: 100px;
    height: 100px;
}

结果

.Duplicate-class-1 {
    background: red;
    width: 100px;
    height: 100px;
}
 .Duplicate-class-2 {
    background: blue;
    width: 100px;
    height: 100px;
}
.Unique-class-1{
    background: purple;
    width: 100px;
    height: 100px;
}
.Unique-class-2{
    background: green;
    width: 100px;
    height: 100px;
}

0 个答案:

没有答案
相关问题