import { createGlobalStyle } from "styled-components";
createGlobalStyle`
@font-face {
font-family: 'Segoe Pro Regular';
font-style: normal;
font-weight: normal;
src: url('SegoePro-Regular.woff') format('woff');
}`
然后,我将import "./components/GlobalStyles";
添加到index.js
我尝试在font-family: Segoe Pro Regular;
的某些组件中使用它,但是它不起作用
我也尝试过导入
import Font from "./SegoePro-Regular.woff"
import { createGlobalStyle } from "styled-components";
createGlobalStyle`
@font-face {
font-family: 'Segoe Pro Regular';
font-style: normal;
font-weight: normal;
src: url(${Font}) format('woff');
}`