8

I am currently not using a Mac for my work, but I came across retina.js while surfing the web. I would like to know if it is necessary to include this library into my web projects? If I don't, would my projects look good on all Mac devices? I currently do not have any issues with work on other devices. I have not previewed it on any apple device yet, as it is still a work in progress.

  • 3
    For what it's worth, retina.js doesn't directly relate to Apple devices. It's about high-DPI screens (= more than one real pixel per virtual px), which includes most smartphones, a decent amount of laptops and even some desktop monitors today. Apple just coined the term "retina" for their high-DPI monitors. – Cedric Reichenbach Nov 14 '16 at 13:25
14

Not even remotely required

It looks like it's primary purpose is to automatically do the work of srcset, an attribute that allows you to specify images for different screen profiles, such as the high-density of Apple's "retina" screens.

srcset is trivial to use and doesn't requirement much extra work on your part. In my opinion, everyone should learn how to use srcset appropriately anyway.

In my opinion, there are several compelling reasons not to use this library.

  • You can do what it does on your own
  • It's yet-another-script to fire on your page, which slows your page
  • It breaks the intended accessibility of srcset (allowing the browser and user to determine how to use the information in srcset, rather than you selecting what to load)

Edit

It is also worth mentioning that several browsers allow you to assign pixel density and other responsive settings using dev tools. For example, Chrome has Device Mode. These are useful for seeing if features like srcset (or retina.js, if you did chose to use that library) are actually working as expected. So you don't need to hunt down or a fancy-pants Mac for testing purposes.

  • thank you very much for your reply. I will look into srcset – ogeh_47 Nov 14 '16 at 10:45
  • @ogeh_47 If this answered your question, can you please accept it? If not, let me know what additional information you need. – Scribblemacher Nov 22 '16 at 13:43
  • Awesome, thanks guys. It is much clearer to me now – ogeh_47 May 21 '17 at 2:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.