Px2rem conversion Settings Font Note / * px*/, fonts are not converted to the set size?

uses amfe-flexible and px2rem adaptable fonts

font-size: 28px; /*px*/

the comment / * px*/ is set as above, but the font finally appears as 24px

according to the way written in the document, the ideal result would be to generate three fonts of 14px, 28px, 42px and three sizes based on dpr.

The font size set on the

root element on font-size: 37.5pxpheroment body is 24px.These two should be the font sizes added by flexible? But why doesn"t the font-size: 28px; / * px*/ set take effect?

it does convert

when using / px /.
[data-dpr="1"] -sharptop-nav {
  font-size: 14px;
}

[data-dpr="2"] -sharptop-nav {
  font-size: 28px;
}

[data-dpr="3"] -sharptop-nav {
  font-size: 42px;
}

but why is it overwritten by the font size on body


if you need rem to not take effect, you can font-size: 28px; / * no*/


the reason for this problem is that flexible will not add data-dpr for me because I have set viewport, and the selector under [data-dpr] will not take effect.
solution:

  1. add your own data-dpr manually
  2. Delete viewport and let flexible add it for you
Menu