在Sass文件中使用指南针帮助者中的图像宽度



我的问题是我想使用指南针助手,我想使用图像宽度方法。我怎样才能做到这一点?我运行了命令compass init,它为我制作了一些CSS文件和配置文件。我认为我必须导入compass/helpers,但找不到吗?在此代码中,我希望在计算$bannerOneHeight变量

中计算高度时获得图像$bannerOneWidth_pure的真正宽度。
$bannerOneWidth_pure: image-width("../image/pop-1-2.png");
$bannerOneWidth: 300px;
$bannerOneHeight: calc(#{$bannerOneWidth}*(#{$bannerOneWidth_pure}/560));

尝试以下:

@import "compass";
@import "compass/helpers";

最新更新