Is there a way to set the default font-family for the entire react app without styled-component?

二次信任 提交于 2021-02-11 18:16:43

问题


I was searching for a way to set the default font-family for the entire react app but all results/packages point to react native instead. For react is there a way to default a global font setting without specifying font-family in every css? Thanks.


回答1:


If I understand your question correctly this should do:

@import url(https://fonts.googleapis.com/css?family=Open+Sans);

body {
   font-family: 'Open Sans',serif;
}


来源:https://stackoverflow.com/questions/59306327/is-there-a-way-to-set-the-default-font-family-for-the-entire-react-app-without-s

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!