2013-10-07 58 views
0

我用指南針,試圖導入我的自定義SCSS文件中application.scss和有這樣的錯誤: enter image description here軌誤差編譯CSS資產

這裏我application.scss代碼:

/* 
* 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"; 

如果我刪除require_tree錯誤信息會消失,但我SCSS文件(pnp.scss)將不會被加載到頁面

+0

哪裏'button'混入位於何處?看來你'pnp'文件試圖使用它,但它無法找到它。 – SombreErmine

回答

1

app/assets/stylesheets創建一個名爲custom.css.scss新的文件,然後用所有的進口有

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

希望它能幫助。

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";