在Visual中,当我在打包的css文件中引入任何变量时,我在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);
}其他小型机工作正常,有办法解决这个问题吗?
发布于 2018-03-24 00:58:44
最后,我将沙斯实现为一个双重解决方案,它既允许多种变量方法,也允许缩小。
发布于 2017-10-02 15:15:00
visual中用于放大CSS的BundlerMinifier库目前无法处理CSS变量。
这一问题已在github https://github.com/madskristensen/BundlerMinifier/issues/218 / https://github.com/xoofx/NUglify/issues/17上提出。
希望这能有所帮助。
https://stackoverflow.com/questions/46203895
复制相似问题