Why does the base font size change when moving from development to production build in reactjs

I use rem as unit for specifying font sizes and for other dimensions. I've also set :root {font-size: 16px} in the stylesheet and everything seems fine but when the build is made, The overall size is reduced.

⇥ Does the build process automatically change the base font size anyhow

⇥ If not, why does this problem occur

Note: Browser window is not zoomed in

1 answer

  • answered 2022-01-13 07:27 Izabela Furdzik

    It is hard to tell without more information.
    Tell something about difference like browser you used, what kind of unit do you use? Pixels or rems? etc. Now, I would check what styles are in body element.

    Build shouldn't change anything, but it depends on details.
    Do you use external styles and what kind of symbols with versioning do you use (see this for more info: https://bytearcher.com/articles/semver-explained-why-theres-a-caret-in-my-package-json/). If you use external styles and locally npm install other package then in build it could do the differece.

    If no of these hints helped, please tell more about the details of your situation.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum