Webstorm配置autoprefixer 自動補全相容首碼

來源:互聯網
上載者:User

標籤:技術   fill   css3   程式   iss   com   tar   搜尋   nal   

webstorm內建CSS3自動補全功能

本文來自:http://blog.csdn.net/pugongying520/article/details/52712639
eg:在樣式檔案border-radius過程中會出現加首碼的樣式,敲斷行符號鍵即可

[css] view plain copy 
  1. <span style="font-family:Microsoft YaHei;">div {  
  2.     -webkit-border-radius:50%;  
  3.     -moz-border-radius:50%;  
  4.     border-radius:50%;  
  5. }</span>  



但某些樣式語句不能自動補全,如
輸入display: flex;


Autoprefixer是一個後處理常式,不象Sass以及Stylus之類的前置處理器。它適用於普通的CSS,可以實現css3代碼自動補全。


使用方法:
step1:安裝node.js (http://jingyan.baidu.com/article/b0b63dbfca599a4a483070a5.html)


step2:安裝Autoprefixer  npm install autoprefixer -g


step3:安裝postcss-cli  npm install postcss-cli -g

 

 

step4:設定webstorm External Tools

開啟webstorm->File->搜尋External Tools->點擊‘+’,設定Edit Tool


 

Name:autoprefixer 

Tool settings

       Program: 找到AppData下的檔案postcss.cm  若找不到AppData,在地址欄輸入%appdata%斷行符號即可

       Parameters:-u autoprefixer -o outputFile inputFile  注意檔案順序輸出檔案及輸入檔案 ,輸入檔案需要先建立,不能自動產生

       Working directory:檔案目錄即可,可根據自己需要調整

 

step5:運行

在輸出檔案中點擊右鍵->autoprefixer ,即可產生新增相容首碼的檔案


 

設定快速鍵


 

Webstorm配置autoprefixer 自動補全相容首碼

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.