Check button contrast in the target store view after publishing the palette. In the example, the white label measured 6.70:1 by default and 2.98:1 on hover.
Read colors from the rendered button
Use developer tools to check color and background-color at rest, on hover and while pressed. Press Tab to check keyboard focus visibility. This local button uses values generated by Hyvä Colors 0.1.8 and an outline supplied by the test theme. Hyvä Colors documentation.
| State | Text or outline | Background | Contrast |
|---|---|---|---|
| Default | #FFFFFF | #1D4ED8 | 6.70:1 |
| Hover | #FFFFFF | #818CF8 | 2.98:1 |
| Active, while pressed | #FFFFFF | #3730A3 | 9.93:1 |
| Focus outline against white | #6D28D9 | #FFFFFF | 7.10:1 |
| Hover after adjustment | #FFFFFF | #4338CA | 7.90:1 |
Use the threshold for the measured pair
For the sample’s regular 16 px label, WCAG 2.2 AA requires at least 4.5:1 against its background. For a custom focus indicator, check the required 3:1 against its adjacent color. The example uses a white gap around the outline. WCAG text contrast · Non-text contrast.
Adjust the affected state and measure again
Changing the hover background to #4338CA brought the ratio to 7.90:1 with the same label color. Repeat the check on that button in the published store view, including when it is focused and hovered at the same time.
