“紧凑"的意思是“紧凑的".在波旁威士忌中使用SASS的函数未调用 [英] "Compact" function in Bourbon with SASS not called
问题描述
我使用Bourbon中包含的mixins有问题. 当此mixin使用Bourbon的"compact"功能时,无需使用它即可将其编译为css. 这是盒装阴影的CSS截图:
I have a problem using mixins included in Bourbon. When this mixin uses the "compact" function of Bourbon, it just compile it into the css without using it. Here is a screenshot of the rendred CSS for a box-shadow :
http://i.stack.imgur.com/YF1JB.png
我在具有最新Sass版本的非静态站点上使用它.我使用Codekit进行编译.
I use it on a non-static site, with the latest Sass version. I use Codekit to compile.
感谢帮助!
推荐答案
好的,所以在更深入地研究之后,我将如何解决它.
Ok so after diving a bit deeper here is how I fixed it.
此问题可能是由于以下提交引起的: https://github.com/thoughtbot/bourbon/commit/ac07c990c0d0fe16f4c455490c9a9fdff7fe27af
This problem is probably being caused because of this commit: https://github.com/thoughtbot/bourbon/commit/ac07c990c0d0fe16f4c455490c9a9fdff7fe27af
紧凑函数已在Ruby中进行了重写,以更好地与Rails集成. 最初,我只是从仓库中复制粘贴了"stylesheet"文件夹.多数民众赞成在我开始错误的语法时.
The compact function has been rewritten in Ruby to better integrate with Rails. Initially I just copy pasted the 'stylesheet' folder from the repo. And thats when I started false sytax.
我通过阅读说明来纠正错误:)-有关如何在Rails中安装它并使其起作用的说明.
I fixed the error by reading the instructions :) - the instruction on how to install it in Rails and then it worked.
在您的情况下,如果idk具有代码包实现,则为idk,但我相信您可以通过添加以下代码来解决它:
In your case, idk if they have a codekit implementation but I believe you can fix it by adding the following code:
@function compact($var-1, $var-2: false,
$var-3: false, $var-4: false,
$var-5: false, $var-6: false,
$var-7: false, $var-8: false,
$var-9: false, $var-10: false) {
$full: $var-1;
$vars: $var-2, $var-3, $var-4, $var-5,
$var-6, $var-7, $var-8, $var-9, $var-10;
@each $var in $vars {
@if $var {
$full: $full, $var;
}
}
@return $full;
}
(我从存储库中获得了代码)
在您的addons文件夹中的文件名_function.scss中,并在_bourbon.scss中引用它.那应该可以解决您的问题.
in a file name _function.scss inside your addons folder and reference it in _bourbon.scss. And that should fix your problem.
这篇关于“紧凑"的意思是“紧凑的".在波旁威士忌中使用SASS的函数未调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!