Automatic resizing for 'non-retina' image versions

前端 未结 9 1522
生来不讨喜
生来不讨喜 2021-01-30 15:03

I\'m looking for a solution that can save me from maintaining two versions of the same image, one for Retina displays (aka @2x), one another for non-Retina displays. My goal is

9条回答
  •  清酒与你
    2021-01-30 15:41

    What I've been doing for our applications is asking our designer to export everything twice as big as it needs to be, then running a little node script to resize the images (anything named @2x in the directory where you run the script). Presently, we're just running the script when every time we deploy (it's idempotent), but it could easily be incorporated into forever -w or some other file-change-watching library like guard.

提交回复
热议问题