1
我知道這是個老問題,但我一直在挖掘我的頭幾個小時。通過所有的SO的鏈接,但仍然無法解決這個問題。Rails 4字體未在SCSS中加載
我的字體位於資產目錄中的字體目錄中。如果我嘗試使用asset-url
它給我錯誤說當我的字體在目錄中時沒有找到Barrio字體。
# application.rb
config.assets.paths << "#{Rails.root}/app/assets/fonts"
config.assets.precompile += %w(.otf)
# style.scss
@font-face {
font-family: "Barrio-Regular";
src: asset-url("Barrio-Regular.otf");
}
.catagories-list {
label {
font-family: "Barrio-Regular, Arial, Helvetica, sans-serif";
font-size: 18px;
}
li {
a {
color: #2c2c2c;
}
margin-bottom: 10px;
text-indent: 20px;
&.active a {
text-decoration: underline;
color: #2f2993;
}
}
}
響應回來你有沒有嘗試過的字體網址助手 – Iceman
@Iceman AFAIK在軌道4,5有沒有更多的字體 - 網址或它已被棄用。 –
你能粘貼整個錯誤信息嗎? –