如何在 Sass 中使用 Ruby/Rails 变量? [英] How can I use Ruby/Rails variables inside Sass?

查看:32
本文介绍了如何在 Sass 中使用 Ruby/Rails 变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在 Sass 文件中使用我的 Ruby 应用程序中的变量?

Is there a way to use variables from my Ruby application inside a Sass file?

推荐答案

您可以将 .erb 扩展名添加到 .sass 文件中,然后像在常规 .erb 文件中一样添加变量:

You can add .erb extention to your .sass file and then add your variables just like in regular .erb file:

<%= APP_CONFIG[:yourkey] %>

更多信息:

这篇关于如何在 Sass 中使用 Ruby/Rails 变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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