多行文本省略號樣式失效丟失,以及控制台顯示autoprefixer警告'Autoprefixer applies control comment to whole block, not to next rules.'


  • 問題現象

  使用webpack壓縮打包vue項目,遇到一個問題,文本多行顯示省略號的關鍵css語句-webkit-box-orient: vertical;莫名其妙丟失失效了。查閱資料,有不少人提出在改樣式前后添加注釋(后處理程序):

/*! autoprefixer: off */
  -webkit-box-orient: vertical;
  /* autoprefixer: on */

  再次打包,發現樣式恢復正常。然后控制台卻多出一條警告:‘(Emitted value instead of an instance of Error) autoprefixer: \static\css\reset\index.css:99:3: Second Autoprefixer control comment was ignored. Autoprefixer applies control comment to whole block, not to next rules.’,這對於強迫症來說是極其難受的。

  • 原因

  正如警告中所說,以上的css處理語句控制的應該是整個css塊,而不是在此之后的css。

  • 處理

  將此處修改為:

/*! autoprefixer: ignore next */
-webkit-box-orient: vertical;

  恢復正常。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM