Images

Images are an essential part of any design system. There is a plethora of information available elsewhere with regards to image best practices. Here we will focus on the approach we’ve applied for the Delta Design System.

Aspect Ratio

In keeping with other features of this design system, we believe that images should be sized and cropped according to the Golden Ratio.

Example of horizontal golden aspect ratio image
Photo: Montreal by Luke Chesser

Responsive Images

Okay… here’s where it gets a little tricky. There are several different ways to render responsive images, and rendering responsive images is the right thing to do. With the Delta Design System, we’re currently only using a solution for retina and non-retina displays.

Adding a srcset attribute to our <img> element enables us to present a high-resolution image only to retina devices and fall back to the low-resolution version for standard screens. The srcset attribute points to a list of alternative image files. The 1x tells the browser to display the lower-resolution image on standard-resolution screens. The 2x means that the higher-resolution image is used for retina screens. Older browsers that don’t understand srcset fall back to the src attribute.

html
<img src="../../assets/images/mountain-2-2x.jpg" srcset="../../assets/images/mountain-2-1x.jpg 1x, ../../assets/images/mountain-2-2x.jpg 2x" alt="Example of vertical golden aspect ratio image">

Important Guidelines

We will add more options for images in a later phase of development, including options for art direction.