3

In order to use

@include box-shadow(0 0 10px black);

you would have to include the "library":

@import "compass/css3";

later in the file, I am including other scss:

@import "sidebar/main";

and in that sidebar/_main.scss, when i call the same:

@include box-shadow(0 0 10px black);

compass breaks with an error:

< ... Undefined mixin 'box-shadow'.>

Does this mean that I'll have to abstract the libraries in my own library file, and then include that file in each and every other scss???

4

1 回答 1

2

将 sidebar/main.scss 重命名为 sidebar/ _main .scss - 无需更改其他代码。

这指示 sass 编译器不要将 sidebar/main.scss 文件编译成单独的 css 文件,而是将其包含在主 scss 文件中。

这个过程是这样的:

sass 编译包含所有内容的主 scss 文件并生成 css(这里没有错误,因为 compass 包含在顶部)抛出错误。

于 2013-05-23T09:16:28.767 回答