在Sass中使用函数将返回包含函数名称而不是结果的字符串 [英] Using a function in Sass is returning the string containing the name of the function rather than the result

查看:114
本文介绍了在Sass中使用函数将返回包含函数名称而不是结果的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试Zurb Foundation 5。

I'm trying Zurb Foundation 5.

因此,我创建了一个新项目并尝试更改设置。例如,当我更改my-project / scss / settings.scss中的 $ row-width:rem-calc(1170); 时,它进行了编译(在my-project中/stylesheets/app.css)放入:

So, I've created a new project and try changing settings. When I changed, for example, $row-width: rem-calc(1170); in my-project/scss/settings.scss, it compiled (in my-project/stylesheets/app.css) into:

.row {
  max-width: rem-calc(1170);
}

似乎对rem-calc函数一无所知。
如何使其正确计算rem-calc?

It seems like it doesn't know about rem-calc function. How to make it calculate rem-calc properly?

推荐答案

您的函数不存在。您必须先声明它(或从另一个文件导入),然后再使用它。 Sass不会为不存在的函数引发错误,因为它们的语法与CSS函数相似。因此,它假设它不是Sass函数,则必须是CSS函数。

Your function doesn't exist. You must declare it (or import it from another file) before you use it. Sass does not throw errors for non-existent functions because they have a similar syntax to CSS functions. So it assumes that if it isn't a Sass function that it must be a CSS function.

相关:测试是否定义了Sass函数

这篇关于在Sass中使用函数将返回包含函数名称而不是结果的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆