五步整理你的css檔案

來源:互聯網
上載者:User

鑒於實在無法忍受那種寫一句就換一行的css寫法,有個項目中的一個css檔案竟然高達6000多行,看著實在蛋疼,無實今天下定決心整理一下,在DW裡可以用正則很好的進行替換,步驟如下:

一:\r => ''
二:} => }\n
二:{\s+ => {
四:;\s+ => ;
五:\/(\*([^\/])+\*)\/  =>  \n/$1/\n

 

說明:

第一步:替換掉css檔案裡所有的換行

第二步:在所有的“}”後加一個換行

第三步:將所有的“{”後面的所有空格去掉

第四步:將所有的“;”後面的所有空格去掉

第五步:將所有注釋作為單獨一行

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.