Accessibility and performance
Heirloom is built so that customers can shop with a keyboard, a screen reader or a touch screen, and so that each page loads only what it needs. Your own content, colors and apps also affect both, so this page explains what the theme does and what’s in your hands.
What Heirloom does for accessibility
Keyboard
Customers can browse, search, filter and buy using only a keyboard.
- The first thing a keyboard reaches on every page is a Skip to content link, which jumps past the header to the page’s main content.
- Menus, search, filters, tabs, slideshows, the cart drawer and popups all work with the keyboard. Arrow keys move between tabs and slides, and Escape closes what’s open.
- When a drawer or popup opens, keyboard focus moves into it and stays there until it closes. Focus then returns to the button that opened it.
Focus
Every link, button and form field shows a clear focus ring when a customer reaches it with the keyboard. It is one solid ring that uses your color scheme, so it stays visible on light and dark backgrounds, stays on while a button is hovered, and is never clipped by the box around it. Dialog titles that take focus from a script, such as a filter drawer, don’t show a browser outline box.
Screen readers
- Pages are marked up with a header, navigation, main content and footer, so screen reader users can move between them.
- Buttons, icons and form fields have names that a screen reader reads out, including icon-only buttons such as the cart and search.
- When a drawer or popup opens, a screen reader announces its title.
- Changes that happen without a page load, such as an item added to the cart or the number of search results, are announced.
- Form errors, such as a wrong storefront password or an invalid email, are shown as text and announced.
- Every page states its language, so screen readers use the right pronunciation in each of Heirloom’s 34 languages.
Motion
Heirloom follows the reduced motion setting on a customer’s device. When it’s on, animations and transitions stop, slideshows stay paused, and video banners show their still image with a play button.
You can also give every customer that still version by turning off Theme settings > Accessibility > Enable motion.
Learn more in Accessibility settings.
Touch
Buttons, fields, quantity boxes and option buttons are 40 pixels tall with a mouse and 44 pixels on touch screens, so they’re easy to tap. Icon buttons, slideshow dots, pagination links and the cart’s remove buttons are at least 44 pixels in each direction. Hover effects only apply on devices with a mouse or trackpad, so a tap never leaves one stuck on.
Images
Product images use the alt text you add in your Shopify admin. When an image has no alt text, Heirloom uses the product title, so a screen reader never reads out a file name. Images that are only decorative, such as icons next to a text label, are hidden from screen readers.
What Heirloom does for speed
Scripts
- The theme’s script files load after the page content, so they don’t hold up the first view of a page.
- The script that every page needs is kept small. Scripts for product pages, the cart and features such as slideshows load only on pages that use them.
- Core shopping works without JavaScript: customers can open a product, choose a variant, add it to the cart and check out with scripts switched off.
Styles and fonts
- The styles that every page needs are kept in one small stylesheet that loads first.
- Text shows right away in a system font while your theme fonts load, so customers never look at a blank page.
Images
- Images are sized for the space they fill, so a phone downloads a smaller image than a large screen.
- The first image on a page, such as the media banner or the main product image, loads first. Images further down load as customers scroll toward them.
- On touch screens, product cards don’t load the second image that appears on hover.
Loading the next page
In browsers that support it, Heirloom starts loading a page when a customer points at its link, so it opens faster. It never does this for the cart, checkout, account or password pages, or for links that change something, such as discount links.
Product recommendations load as a customer scrolls toward them, instead of with the rest of the page.
What you control
Alt text
Add alt text to your product images and to the images in your sections. Describe what the image shows, briefly, as if to someone who can’t see it, such as “Jar of wildflower honey on a wooden board”.
- Add alt text to product images from the product’s media in your Shopify admin. Learn more about adding alt text to product media in Shopify’s Help Center.
- Add alt text to images in sections from the theme editor: click the image in the section’s settings, and then click Edit. Learn more about adding alt text to theme images in Shopify’s Help Center.
Colors and contrast
Heirloom’s theme styles pair each background with a text color that’s easy to read. When you change colors, keep the same balance:
- Change background and text colors together in each color scheme.
- Keep body text dark on a light background, or light on a dark background. Avoid light gray text on cream.
- Check that your sale color and button text stay readable on their backgrounds. A contrast ratio of at least 4.5 to 1 is the level that WCAG recommends for text.
Learn more in Colors.
Text size and headings
- Keep Body size in Theme settings > Typography close to 100%, so text stays readable on phones.
- In pages and blog posts, use headings in order. Start with Heading 2 under the title, and don’t skip levels.
- Write link and button text that makes sense on its own, such as “Shop the coffee range” instead of “Click here”.
Image and video sizes
Shopify serves each image at the size the page needs, but large or uncompressed uploads still slow the first view of a page.
- Upload photos large enough to look sharp, and compress them first. A banner image rarely needs to be more than a few hundred kilobytes.
- Set a focal point on banner images, so the important part stays in view when the image is cropped.
- Keep background videos short and silent.
- Keep the first screen of your home page simple. Each section and each large image above the fold adds to what loads first.
Apps
Apps can add scripts, styles and content to every page, and they’re the most common cause of a slow or hard-to-use store. Heirloom can’t control the code that apps add.
- Install only the apps you use, and remove the ones you don’t.
- When you remove an app, also turn off its app embed in the theme editor, from App embeds.
- After you install an app, check your store with a keyboard and on a phone.
Check your store
Before you launch, and after large changes, check your store the way your customers use it.
Steps:
- Open your online store, and then press Tab repeatedly. Check that you can see where you are on every page.
- Using only the keyboard, find a product, add it to the cart and go to checkout.
- Turn on reduced motion on your device, and then check your home page.
- Open your store on a phone, and then check your home page, a collection and a product.
Learn more about improving your store’s speed and accessibility in Shopify’s Help Center.
Related
- Learn more about accessibility settings.
- Learn more about colors and color schemes.
- Learn more about banners.
- Learn more about checking your store before you launch.