masakudamatsu / line-height-picker

A front-end web app that helps web designers/developers pick the best line-height value for their websites
https://line-height-picker.vercel.app
MIT License
2 stars 1 forks source link

Add diagrams for background info #214

Closed masakudamatsu closed 4 years ago

masakudamatsu commented 4 years ago

The image width needs to be 605px on screens.

To deal with retina displays (2x for iPhone 4 and above, 3x for iPhone 6plus and above), we need to prepare three resolutions: 605px, 1210px, and 1815px.

Sketch App can export the same image in different resolutions. So we need to create 605px x 403px images (aspect ratio of 1.5 to 1).

Then use the following syntax

        <FigureFrame>
          <Image
            src={imageMarginTop1x}
            srcset={`${imageMarginTop1x} 1x, ${imageMarginTop2x} 2x, ${imageMarginTop3x} 3x`}
          />
        </FigureFrame>

where the images are imported with

import imageMarginTop1x from '../img/margin-top1x.png';
import imageMarginTop2x from '../img/margin-top2x.png';
import imageMarginTop3x from '../img/margin-top3x.png';

References:

masakudamatsu commented 4 years ago

We do not use the image optimization for retina screens. We always use the 3x images.