DEV Community

Discussion on: 10 useless NPM Package with millions of downloads

Collapse
eliezerpp profile image
Eliezer Peña

In my personal experience is better check the viewport size (i.e: with window.matchMedia)

Collapse
jcubic profile image
Jakub T. Jankiewicz

I think that it fail on iPhone with retina in horizonntal mode. vewport size is not best way to test for mobile.

Thread Thread
eliezerpp profile image
Eliezer Peña

I think not, because the viewport pixels is not based on the real pixels of the device. You can also test and share your results ;)

Here is some documentation about how the CSS Units works webplatform.github.io/docs/tutoria...