I solved this problem by changing percentages by pixels
@media (max-width: 96em) { html { font-size: 8px; } }
The browser uses a standard font size of 16 pixels . When we use rem for adaptation, for simplicity of calculation, we specify a font size of 62.5% of 16 pixels, which is 1em = 10px. When we adapt to other permissions, we proportionally change this value. For example, for a resolution of 1280px this will be
1920/1280 = 1.5, 62.5 / 1.5 = 41.667 (%).
At 1440px - 62.5 / (1920/1440) = 46.875 (%).
All browsers except Safari understand that in media queries the font size is indicated as a percentage. I solved the problem by converting the percentage to pixels.
1280: 41.667% * 16px = 6.66672 px
1440: 16 * 0.46875 = 7.5.
And so on.
Dima Klimyuk
source share