Using REMs instead of Pixels

Hello,

I really like the Ionic framework. However, I’m interested as to why pixels are used instead of REMs. I kind of fear that when iPhone 6 comes out, if it has a larger screen that my app will render horribly. Any thoughts on this?

Thank you!

1 Like

I cant speak for the ionic guys as to why they chose to use pixels but I can share why I prefer pixels over rems. Take a look at this post about the css pixel

Its actually a good read and pretty short but basically boils down to this

CSS defines the reference pixel, which measures the size of a pixel on a 96 dpi display. On a display that has a dpi substantially different than 96dpi (like Retina displays), the user agent rescales the px unit so that its size matches that of a reference pixel. In other words, this rescaling is exactly why 1 CSS pixel equals 2 physical Retina display pixels.

Thank you for the feedback. I wasn’t aware of that. I’m curious, does the rescaling also handle padding as well?

Thanks!

Yup, it should take care of that

hi …is it possible to use dp and sp instead of px in css files