Kindred Contrast Accessible Text Colours with CSS: Automatically Ensuring WCAG Contrast
When designing accessible websites, the contrast between text and background is essential. The Web Content Accessibility Guidelines (WCAG) require a minimum contrast ratio of 4.5:1 for normal text at Level AA. But how can this be reliably achieved in a flexible design system without having to define a suitable text colour manually for every colour combination? This is exactly where Kindred Contrast comes in.
Kindred Contrast uses modern CSS features to select a colour from the available palette that provides sufficient contrast against the respective background. Instead of relying exclusively on black or white, it can use a suitable colour from the existing palette. This keeps text colours consistent with the overall design while maintaining readability. When working with different background colours, there is no need to define every possible combination manually.
Accessibility from the start: built into the Joomla design system
The idea emerged from work on the Joomla design system. Accessibility should not be treated as an afterthought, but built in from the very beginning. Website creators should not have to worry about contrast ratios every time they make a colour choice. Automatic colour selection saves time and helps prevent common mistakes. It works with pure CSS, without any JavaScript, and supports both light and dark colour schemes. The resulting colour combinations must still meet the required WCAG contrast ratios. Automatic calculation helps achieve this, but does not replace final verification.
Find out exactly how it works here: Kindred Contrast: Test your colors