sass中使用calc不能包含变量的问题

子成君 582 0

直接height: calc(100% - $top-main-height);这样写是不生效的

sass并不会在calc中解析变量,必须使用sass插值的方式编写

sass的插值方法:   (#{$variable})

上述代码更正后:

height: calc(100% - #{$top-main-height});

sass仓库相关issue地址: https://github.com/sass/sass/issues/2166#issuecomment-254511098

发表评论 取消回复
OwO 图片 链接 代码

分享