Fix color-contrast in Shopify Liquid
Shopify Online Store 2.0 themes (including Dawn) frequently fail color-contrast when theme color_schemes apply rgba(var(--color-foreground), 0.55) to secondary prices, captions, or sale badges. Because Dawn injects CSS custom properties from config/settings_data.json into layout/theme.liquid, a single pale opacity rule breaks every collection and product page.
Before and after
{%- comment -%} snippets/price.liquid + assets/component-price.css (Broken) {%- endcomment -%}
<div class="price">
<span class="price-item price-item--regular" style="color: rgba(var(--color-foreground), 0.45);">
{{ product.compare_at_price | money }}
</span>
<span class="badge price__badge-sale" style="background: #34d399; color: #ffffff;">
{{ 'products.product.on_sale' | t }}
</span>
</div>{%- comment -%} snippets/price.liquid + assets/component-price.css (Fixed >= 4.5:1) {%- endcomment -%}
<div class="price">
<span class="price-item price-item--regular" style="color: rgba(var(--color-foreground), 0.78);">
<span class="visually-hidden">{{ 'products.product.price.regular_price' | t }}</span>
{{ product.compare_at_price | money }}
</span>
<span class="badge price__badge-sale" style="background: #047857; color: #ffffff;">
{{ 'products.product.on_sale' | t }}
</span>
</div>Fixed vs. broken example
Inspect the foreground and background colors in Chrome DevTools Color Picker to verify the live WCAG AA (4.5:1 normal text, 3:1 large text) contrast badges.
Playwright + axe-core check
import { test, expect } from "@playwright/test";
import AxeBuilder from "@axe-core/playwright";
test("Shopify product price & sale badge pass color-contrast", async ({ page }) => {
await page.goto("/products/cobalt-ceramic-mug");
const results = await new AxeBuilder({ page })
.include(".product__info-wrapper")
.withRules(["color-contrast"])
.analyze();
expect(results.violations).toEqual([]);
});Template deduplication tip
A faded .price-item--regular opacity rule inside assets/component-price.css or snippets/price.liquid can generate 500+ raw violations across /products/* and /collections/*. A11yDrift groups all of them into one cluster pointing to the shared Liquid price partial.
Who this affects
Low-vision readers, older users with presbyopia, people with color-vision deficiencies, and anyone viewing a screen in bright sunlight struggle or fail to read muted gray captions, pale badges, and low-contrast CTA buttons.
NVDA & VoiceOver transcript
Screen readers announce the same copy for both versions; this rule primarily impacts low-vision readers, screen magnifiers, and visual legibility.
NVDA (Windows)
Screen readers still speak "Free shipping on orders over $75" and "Add to Cart, button", but screen magnifier and low-vision users cannot visually locate or read the faded copy and pale blue button.
Screen readers announce "Free shipping on orders over $75" and "Add to Cart, button", while sighted low-vision and ZoomText users clearly distinguish both the 7.58:1 body copy and 5.93:1 CTA.
VoiceOver (macOS / iOS)
VoiceOver speaks "Add to Cart, button", yet users combining VoiceOver with Zoom or macOS Increase Contrast experience severe glare washout on the 2.14:1 sky-blue fill.
VoiceOver speaks "Add to Cart, button", and the 5.93:1 darkened surface stays legible across macOS Zoom, mobile sunlight, and high-brightness displays.
Common questions
Why does Shopify Dawn fail contrast on compare-at prices and footer links?
Can a Shopify theme app or overlay widget fix Liquid contrast issues?
Does WCAG 2.2 AA allow lower contrast on large hero headings in Shopify sections?
Test a URL for color-contrast
Enter any public URL for a free WCAG 2.2 AA check—no account or credit card required.
Managing Shopify Liquid client sites? Monitor 15 sites on one flat plan with white-label portals and branded executive PDFs—$1,140/yr ($95/mo billed annually, 24-month rate lock + onboarding) for Founding 10 agencies.