2013-10-07 3 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' mixin? Кажется, ваш файл 'pnp' пытается его использовать, но он не может его найти. – SombreErmine

ответ

1

Создать новый файл с именем custom.css.scss в app/assets/stylesheets, а затем использовать весь импорт там

@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"; 
Смежные вопросы