Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 添加';预加载';使用Wordpress中的字体_Css_Node Modules_Preload_Google Pagespeed Insights Api - Fatal编程技术网

Css 添加';预加载';使用Wordpress中的字体

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('#{

通过节点模块,我将这个文件添加到我的主题中。但它在“谷歌Pagespeed Insight”中有所体现考虑使用
对稍后在页面加载中请求的当前获取资源进行优先级排序

在我的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