如何在 sass 中使用链轮进口 [英] how to use sprockets imports with sass

查看:50
本文介绍了如何在 sass 中使用链轮进口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含以下内容的 application.css.scss -

I have a application.css.scss with the following content -

@import bootstrap

现在我想使用 chosen-rails gem,并添加以下 sprokets 指令到我的 application.css.scss 文件 -

Now I would like to use the chosen-rails gem, and add the following sprokets directive to my application.css.scss file -

*= require chosen

我安装了 sprockets-sass gem,并将我的 application.css.scss 文件更改为-

I installed the sprockets-sass gem, and changed my application.css.scss file to -

@import bootstrap
//*= require chosen

但是我没有看到选择的 css 出现,我做错了什么?

However I dont see the chosen css appear, what am I doing wrong?

推荐答案

尝试仅使用 @import 语法:

@import 'bootstrap'
@import 'chosen'

'sass-rails' gem 指示不要使用 SASS 文件中的 require 语法.

The 'sass-rails' gem instructs not use the require syntax in SASS files.

这篇关于如何在 sass 中使用链轮进口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆