Shopify Liquid fix

Before and after

Broken — before
{%- comment -%} snippets/social-icons.liquid (Broken: empty icon anchor) {%- endcomment -%}
{%- if settings.social_instagram_link != blank -%}
  <li class="list-social__item">
    <a href="{{ settings.social_instagram_link }}" class="list-social__link">
      {%- render 'icon-instagram' -%}
    </a>
  </li>
{%- endif -%}
Fixed — after
{%- comment -%} snippets/social-icons.liquid (Fixed: visually-hidden destination + aria-hidden SVG) {%- endcomment -%}
{%- if settings.social_instagram_link != blank -%}
  <li class="list-social__item">
    <a
      href="{{ settings.social_instagram_link }}"
      class="list-social__link"
      rel="noopener noreferrer"
    >
      <span aria-hidden="true">{%- render 'icon-instagram' -%}</span>
      <span class="visually-hidden">
        {{ shop.name | escape }} on {{ 'general.social.links.instagram' | t | default: 'Instagram' }}
      </span>
    </a>
  </li>
{%- endif -%}
Live preview

Fixed vs. broken example

Passes link-name
Accessibility tree: role="link", accessible name="View A11yDrift on GitHub" (SVG marked aria-hidden="true")

Open the VoiceOver Web Rotor (Control+Option+U) or NVDA Elements List (NVDA+F7) to confirm every icon anchor shows a clear destination label.

Automated test

Playwright + axe-core check

tests/a11y-link-name.spec.ts
import { test, expect } from "@playwright/test";
import AxeBuilder from "@axe-core/playwright";

test("Shopify header cart, logo, and footer social links pass link-name", async ({ page }) => {
  await page.goto("/");
  const results = await new AxeBuilder({ page })
    .withRules(["link-name"])
    .analyze();
  expect(results.violations).toEqual([]);
});

Template deduplication tip

Unlabeled Instagram/TikTok icons in snippets/social-icons.liquid or the cart link in sections/header.liquid fire on every single storefront URL. A11yDrift collapses hundreds of raw link-name failures into one global header/footer cluster.

Screen readers

What NVDA and VoiceOver announce

Screen-reader users routinely pull up a rotor or links list to jump straight to destinations. Bare icon anchors, empty product-image wrappers, or unlabeled social links appear as meaningless raw URLs or blank entries.

NVDA (Windows)

Broken

"link, #social-demo" (raw href fragment read verbatim)


Fixed

"View A11yDrift on GitHub, link"

VoiceOver (macOS / iOS)

Broken

"link" (or raw URL path)


Fixed

"View A11yDrift on GitHub, link"

Common questions

Why do Shopify full-card stretched links fail axe-core link-name?
Many themes render an empty <a href='{{ product.url }}' class='full-unstyled-link'></a> overlaid with CSS ::after on top of a product card. Place the product title text directly inside the <a> tag instead of leaving it empty.
What accessible name should a Shopify header logo link use?
Either give the logo <img> an alt like "{{ shop.name }} — Home" or put aria-label="{{ shop.name }} home" on the wrapping <a href='{{ routes.root_url }}'> with alt="" on the decorative logo graphic.
Should external Shopify social links open in a new tab?
Only when genuinely helpful; if you keep target='_blank', indicate it cleanly in the accessible name (e.g., 'Instagram (opens in a new tab)') and include rel='noopener noreferrer'.