[英]How to load style.scss file in application.css file ruby on rails
I have ruby on rails project in which I want to include scss files in my style sheets that is application.css 我在ruby on rails项目中想在我的样式表中包含scss文件,即application.css。
The directory structure is look like below: 目录结构如下所示:
The problem is that when I try to do this in my application.css file: 问题是,当我尝试在application.css文件中执行此操作时:
*= require font-awesome
*= require bootstrap
*= require slick
*= require basic-theme
*= require style
*= require_self
@import url("style.scss"); //it is in scss folder.
it still does not parse the code in it. 它仍然不解析其中的代码。 Also if I set the path with assets/ it does load it but gives error like:
另外,如果我使用资源设置路径/它确实会加载它,但会给出如下错误:
Sass::SyntaxError in Home#index
Undefined variable: "$base-font".
How I can easily import all these scss files in my rails app? 如何在Rails应用程序中轻松导入所有这些scss文件? Also any best practices please?
还有任何最佳做法吗?
相反,您需要使用
@import "<relative path to style.css without .scss>"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.