0

I'm using compass, try to import my custom scss file in application.scss and have this error: enter image description here

here my application.scss code:

/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
 * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the top of the
 * compiled file, but it's generally better to create a new file per style scope.
 *
 *= require_self
 *= require_tree
 */

@import "foundation_and_overrides";
@import "pnp";

if I remove require_tree error message will disappear but my scss file (pnp.scss) will not be loaded to the page

4

2 回答 2

1

创建一个名为custom.css.scssin的新文件app/assets/stylesheets,然后使用那里的所有导入

@import "foundation_and_overrides";
@import "pnp";

希望能帮助到你。

于 2013-10-07T12:34:03.037 回答
0

您的问题可能是 require_self 在 require_tree 之前发生。这意味着pnp样式将无法访问可能在它之后加载的任何其他样式表(即,包含混合)。

为了避免这种混淆,我通常将所有导入保存在一个 SCSS 文件中,并且只需要在 application.css 中使用它。

# application.css

/*
 *= require normalize
 *= require base
*/


# base.scss

@import "foundation_and_overrides";
@import "constants";
@import "buttons";
@import "pnp";
于 2013-10-07T12:32:18.227 回答