عربي
News
●E-invoicing: the last date to connect for wave 25 is February 1, 2027●WhatsApp Business: service messages are paid after 1,000 free per month●Salla acquires Paylink to strengthen payment solutions for merchants●Google launches a Gemini agent for businesses first, then consumers●Hostinger's White Friday deals continue until December 14

Check the contrast of store button text against WCAG

Measure text contrast in each button state and hand off the chosen colors with their ratios.

The problem

A white Add to cart label sits on a light orange button. It looks legible on your design monitor and fades on a dimmer phone. Record the actual color pair in each state so the visual judgment has a measurable check.

The tool

WCAG 2.2 Level AA sets a contrast minimum of 4.5:1 for ordinary text and 3:1 for text that meets its definition of large. Apply that criterion to the button label and record the result with the design.

The steps

  1. Capture the text color and the background directly underneath. Compare design values with computed browser values, especially if a layer is translucent.
  2. List the default, hover and keyboard focus states. For each, record the button name, text color and background color.
  3. Enter each color pair in a contrast checker. As a reference, white #FFFFFF over gray #767676 is about 4.54:1. With #777777 it is about 4.48:1.
  4. Compare the unrounded ratio with the correct minimum. A result of 4.48:1 misses 4.5:1 even if a tool displays fewer decimal places.
  5. Adjust one color and recheck all affected states. If your site uses dark mode, check the dark color pairs separately.
  6. Send the developer the color values, state names and ratios. Once implemented, use the keyboard to reach the button and confirm that the label remains legible.

The real cost

The specification is freely available and a free checker is enough for a solid color pair. Early review helps keep implementation revisions down.

The free alternative

Use the browser's built-in developer tool if it reports the computed contrast for the element. Gradients and photos still need a check at the spot where the label sits.

Notes

  • We have not tried these steps ourselves yet. They are based on the official docs. Button names may change. If your interface differs, follow the docs.
  • Avoid rounding a failing value up to the threshold.
  • Text contrast is one check. The control boundary and focus indicator have their own considerations.

Sources

  1. w3.org

Did you like this guide?

The weekly newsletter is being prepared. Leave your email and we'll send it when it launches.

We use your email only to send the newsletter. Privacy policy