Rails 5应用程序和Heroku中的自定义字体 [英] Custom fonts in rails 5 app and Heroku

查看:94
本文介绍了Rails 5应用程序和Heroku中的自定义字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您能指导我如何在Rails 5应用程序中添加自定义字体吗?我已将我的自定义字体文件添加到应用程序/资产中的 fonts文件夹中.我继续在 .scss 中使用@fontface和font-url,但是之前的字体不会生效,并且[在此输入图像描述后将其推送到heroku.

can you please instruct me on how to add custom fonts to my rails 5 application? i've added my custom fonts files to fonts folder in app/assets. i went on to use the @fontface and font-url in .scss, but my fonts wont take effect after before and[enter image description here pushing to heroku.

在此处输入图片描述

推荐答案

我建议您去修改application.html并在其中添加字体.我不知道您要做什么,而是添加一个简单的

I suggest you go modify your application.html and add the fonts there. I don't know what you are trying to do but adding a simple

<link href="fonts.googleapis.com/css?family=Roboto"; rel="stylesheet"> 

在标题中可能就足够了.

In your header might be enough.

这篇关于Rails 5应用程序和Heroku中的自定义字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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