Sass 在 Laravel Mix ^4.0.7 中将背景位置值编译为 100%
Sass compiles background-position values to 100% in Laravel Mix ^4.0.7
如何阻止 SASS 将 background-property
编译为 100%
?
background-position: center right #{"calc(.4em + .1875rem)"};
我尝试对值应用 string interpolation,就像我对 calc 函数所做的那样。
background-position: #{"center"} #{"right"} #{"calc(.4em + .1875rem)"};
我期待的是非计算字符串,只有 center right calc(.4em + .1875rem)
作为值。
似乎是 CssNano 中的 normalizePositions
选项在 Laravel Mix 中设置为默认值。
要解决此问题,只需禁用该选项即可:
mix.options({
cssNano: {normalizePositions: false}
});
如何阻止 SASS 将 background-property
编译为 100%
?
background-position: center right #{"calc(.4em + .1875rem)"};
我尝试对值应用 string interpolation,就像我对 calc 函数所做的那样。
background-position: #{"center"} #{"right"} #{"calc(.4em + .1875rem)"};
我期待的是非计算字符串,只有 center right calc(.4em + .1875rem)
作为值。
似乎是 CssNano 中的 normalizePositions
选项在 Laravel Mix 中设置为默认值。
要解决此问题,只需禁用该选项即可:
mix.options({
cssNano: {normalizePositions: false}
});