去掉 Laravel 项目中引入的 Raleway 字体

Laravel 项目中引入 Raleway 字体的地方有两处:

  1. public/css/app.css
@import url(https://fonts.googleapis.com/css?family=Raleway:300,400,600);@charset "UTF-8"; ...
  1. resources/assets/sass/app.scss
// Fonts
@import url("https://fonts.googleapis.com/css?family=Raleway:300,400,600");

// Variables
@import "variables";

// Bootstrap
@import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap";

把这两处中引入 Raleway 的地方删掉即可。

你可能要问,为什么要删?

答案是因为一个众所周知的原因,google 字体的加载可能非常缓慢,导致页面长时间处于空白、无响应状态。

本作品采用《CC 协议》,转载必须注明作者和本文链接
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
讨论数量: 6

这里还有两种解决方案:

下载:

使用 google-webfonts-helper
下载后 import css 进来

替换为科大节点:

修改 fonts.googleapis.comfonts.lug.ustc.edu.cn 即可

7年前 评论

@tradzero 我没试过。在这里之所以「去掉 Raleway 字体」是为了让初学者少踩一个坑 :wink:

7年前 评论

因為一個眾所周知的原因 :smile:

7年前 评论

@zhangbao 你是看不出来他在笑你这句话不通顺么?:joy:

7年前 评论