Css 添加';预加载';使用Wordpress中的字体
通过节点模块,我将这个文件添加到我的主题中。但它在“谷歌Pagespeed Insight”中有所体现考虑使用Css 添加';预加载';使用Wordpress中的字体,css,node-modules,preload,google-pagespeed-insights-api,Css,Node Modules,Preload,Google Pagespeed Insights Api,通过节点模块,我将这个文件添加到我的主题中。但它在“谷歌Pagespeed Insight”中有所体现考虑使用对稍后在页面加载中请求的当前获取资源进行优先级排序 在我的CSS文件中,它是这样导入的 @font-face { font-family: 'Graphik Web'; src: local('Graphik Web'), url('#{$spirit-font-path}Graphik-Regular-Web.woff2') format('woff2'), url('#{
对稍后在页面加载中请求的当前获取资源进行优先级排序
在我的CSS文件中,它是这样导入的
@font-face {
font-family: 'Graphik Web';
src: local('Graphik Web'), url('#{$spirit-font-path}Graphik-Regular-Web.woff2') format('woff2'),
url('#{$spirit-font-path}Graphik-Regular-Web.woff') format('woff');
font-weight: 400;
font-style: normal;
font-stretch: normal;
font-display: swap;
}
但它仍然没有像谷歌Pagespeed Insight的报告中那样工作。如果我认为遗漏了什么或添加了什么,请告诉我。要消除该错误,您必须去掉@import(此处翻译为src url)。@import指令阻止并行下载。您必须更改代码,才能在带有链接标记的主html中导入woff