[英]VS MVC Project CSS Minification fails when using CSS variables
在Visual Studio中,當我在捆綁的CSS文件中引入任何變量時,Minification在我的MVC項目中失敗了。 例:
/* Minification failed. Returning unminified contents.
(3,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '-'
(6,23): run-time error CSS1039: Token not allowed after unary operator: '-main-bg-color'
*/
:root {
/*DEFAULT COLORS LINES*/
--main-bg-color: rgb(34,34,34);
}
body{
background-color:var(--main-bg-color);
}
其他縮小器工作正常,是否可以解決此問題?
Visual Studio中用於放大CSS的BundlerMinifier庫當前無法處理CSS變量。
這個問題已經提出在github https://github.com/madskristensen/BundlerMinifier/issues/218 / https://github.com/xoofx/NUglify/issues/17 。
希望這可以幫助。
我最終實現了Sass作為雙重解決方案,該解決方案既可以實現多種可變方法,又可以實現最小化。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.