📜  gatsby 中的字体 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:57.950000             🧑  作者: Mango

代码示例1
$ npm install typeface-rubik
// Configuration
// Now we’ll require the font in our gatsby-browser.js,
// where we interact with the client-side of Gatsby.

// gatsby-browser.js
require("typeface-rubik");
// And we can go ahead and call the font in our stylesheet/styled-components like we normally would.

// src/styles/main.css
body {
  font: 400 18px Rubik, sans-serif;
}