简体   繁体   English

如何在整个反应应用程序中更改字体大小?

[英]How to change the Font Size in a whole react application?

I have created a react web application with the dropdown consist of font size.我创建了一个反应 web 应用程序,其下拉菜单包含字体大小。

My need is, if i select the Font Size "26" from the dropdown, then it should be applied to my whole project.Is there a way could it be done?我的需要是,如果我 select 下拉菜单中的字体大小“26”,那么它应该应用于我的整个项目。有什么办法可以做到吗?

Personnally i would make a global style file with a styleSheet that i import on every component to use it.个人而言,我会使用我在每个组件上导入的 styleSheet 制作一个全局样式文件以使用它。 With this file you can use a variable from your storage (ex: font style) and apply it to all font-size directives.使用此文件,您可以使用存储中的变量(例如:字体样式)并将其应用于所有字体大小指令。 Good luck !祝你好运 !

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM