[英]How to handle Bower components images, fonts or other assets (with yeoman)?
[英]How to load fonts in PhalconPHP with CSS in a bower package?
我正在嘗試在PhalconPHP應用程序中加載Roboto
google字體。 我已經使用bower
安裝了roboto-fontface
並且嘗試使用_fonts.scss
文件中的@font-face
在本地加載其字體。
這是我的字體加載“代碼”:
$roboto-font-path: '../../bower_components/roboto-fontface/fonts/roboto/';
@font-face {
font-family: "Roboto";
src: //local(Roboto Thin),
url("#{$roboto-font-path}Roboto-Thin.woff2") format("woff2"),
url("#{$roboto-font-path}Roboto-Thin.woff") format("woff");
font-weight: 100;
}
我正在使用的url似乎有效,但是在檢查Firefox中實際發生的情況時,我得到了以下內容(這是我的index.volt
的內容): Firefox的屏幕截圖 。
當然,我可以使用<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
加載該字體,但是將來在使用多種字體時會降低加載時間。
有什么幫助嗎?
每個PhalconPHP應用程序根目錄中的.htacces
會將所有傳入請求重定向到public
目錄。 我的bower_components
不在此目錄中。 使用.bowerrc
文件將bower_components
移動到public
目錄中,並修改了一些路徑。 現在就像一個魅力__(ツ)_ /¯。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.