問題描述
我希望從多個(gè)文件中刪除重復(fù)的 CSS 聲明,以便更輕松地實(shí)施更改.有沒有工具可以幫助我做到這一點(diǎn)?
I'm looking to remove duplicate CSS declarations from a number of files to make implementing changes easier. Is there a tool that can help me do that?
現(xiàn)在我面臨這樣的事情:
Right now I'm faced with something like this:
styles.css
#content {
width:800px;
height:1000px;
background: green;
}
styles.game.css
#content {
width:800px;
height:1000px;
background: blue;
}
我想要這個(gè):
styles.css
#content {
width:800px;
height:1000px;
background: green;
}
styles.game.css
#content {
background: blue;
}
所有文件的總行數(shù)遠(yuǎn)遠(yuǎn)超過 10k,因此不能選擇依賴手動(dòng)編輯的技術(shù).
The total number of lines across all files is well over 10k, so techniques that rely on manual editing aren't an option.
推薦答案
我為此專門編寫了一個(gè)工具,名為 csscss.作為獎(jiǎng)勵(lì),它還與 Sass 和 LESS 集成.試一試,如果您在 github 中遇到問題,請(qǐng)告訴我.
I wrote a tool specifically for this purpose called csscss. As a bonus it also integrates with Sass and LESS. Give it a shot and let me know if you have an issues in github.
這篇關(guān)于刪除多個(gè)文件中的重復(fù) CSS 聲明的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!