字体/样式表未在Rails生产中加载

计算的

我有一个刚刚部署到9倍的Rails 4应用程序。样式表或字体均未呈现。

在我的资产文件夹中 layout/fonts/*all-my-font-files

然后在“ social.css.scss”中,我有:

@import '/layout/fonts';

@font-face {
font-family: 'Mono Social Icons Font';
src: asset_url('MonoSocialIconsFont-1.10.eot');
src: asset_url('MonoSocialIconsFont-1.10.eot?#iefix') format('embedded-opentype'),
     asset_url('MonoSocialIconsFont-1.10.woff') format('woff'),
     asset_url('MonoSocialIconsFont-1.10.ttf') format('truetype'),
     asset_url('MonoSocialIconsFont-1.10.svg#MonoSocialIconsFont') format('svg');
src: asset_url('MonoSocialIconsFont-1.10.ttf') format('truetype');
font-weight: normal;
font-style: normal;

}

这样对吗?

约书亚·帕林

而不是asset_url使用font-url

您不需要这个: @import '/layout/fonts';

就像这样:

@font-face {
    font-family: 'Mono Social Icons Font';
    src: font-url('MonoSocialIconsFont-1.10.eot');
    src: font-url('MonoSocialIconsFont-1.10.eot?#iefix') format('embedded-opentype'),
         font-url('MonoSocialIconsFont-1.10.woff') format('woff'),
         font-url('MonoSocialIconsFont-1.10.ttf') format('truetype'),
         font-url('MonoSocialIconsFont-1.10.svg#MonoSocialIconsFont') format('svg');
    src: font-url('MonoSocialIconsFont-1.10.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章