Mobile REM Adaptation: The Conversion Pipeline Behind rootValue and Dynamic Root Font Size
Developers who confuse rootValue with the html font-size will ship layouts that break on resizing or waste time chasing a phantom conversion bug. Knowing the two-stage pipeline lets you configure rootValue from the source CSS scale and predict exactly how each rem will render at any viewport width.
The common mobile adaptation scheme of postcss-pxtorem plus a dynamic root font size works in two separate stages. At build time, the PostCSS plugin converts any eligible px value into rem by dividing by a configured rootValue, typically 37.5 for a 375-based design. At runtime, a script or library like amfe-flexible sets the html font-size to the layout viewport width divided by 10. The browser then computes every rem declaration from that font size, so a card declared as 4rem grows to 165.6px on a 414px viewport and shrinks to 150px on 375px. The two numbers equal each other only at the baseline width; change the viewport and the html font-size moves while rootValue stays fixed.
The article stresses that rootValue is not the html font-size and that the 10 multiplier is a project convention, not a rem rule. The chosen rootValue must match the dimension scale actually written in the source CSS, whether that is 375, 750, or a halved 750. The plugin never re-runs when the window resizes, so all responsiveness comes from the runtime root font size. The piece also warns that propList: ["*"] does not convert every px in the project, that px inside media query conditions is controlled by mediaQuery, and that inline styles and JavaScript numbers stay untouched. Font scaling, layout overflow, and readability need separate attention, because rem only handles size relationships.
The article's sharpest point is that rootValue and the root font size are two different numbers that happen to coincide at the design baseline; conflating them leads to debugging the wrong layer of the stack.
The choice between 37.5 and 75 is a source-code convention issue, not a device-pixel-ratio matter, which is a recurring source of misunderstanding on interview questions and in real projects.
Treating rem as a viewport unit rather than a root-font-size unit is a common mental model error; the dynamically updated root font size is what creates the responsiveness, and that distinction is easy to miss when reading code.
The separation of rootValue and root font size is spot on; the two 37.5 values look identical but aren't the same thing. For the 750 design draft, choosing 75 or 37.5, I used to make assumptions without thinking.