My theme build fails if any color misses WCAG contrast, here's the pipeline

A

Adil Sher

Author

Jul 30, 2026
5 min read
6 views
My theme build fails if any color misses WCAG contrast, here's the pipeline

Summary

The problem with

One palette file, thirteen apps

The gate

def contrast(a: str, b: str) -> float: la, lb = rel_lum(a), rel_lum(b) hi, lo = max(la, lb), min(la, lb) return (hi + 0.05) / (lo + 0.05)

Confession: v1 of this gate had holes

Tuning by binary search, not by eye

What I'd tell other theme authors

Links

Source

This article discusses content originally published by at Dev.to.

Read the original article

Share this article

Written by Adil Sher

Full stack developer building high-traffic platforms, AI services, and custom web applications. Explore my portfolio, learn about my background, or get in touch.

Related Articles

Stop Asking Users to "Have a Look": The UAT Lesson I Learned the Hard Way
Programming Aug 19

Stop Asking Users to "Have a Look": The UAT Lesson I Learned the Hard Way

I still remember the migration project that taught me this lesson. It was a healthcare system overhaul, data, workflows, everything. We spent four months rebuilding the database, testing the ETL pipeline obsessively, and felt genuinely confident about go-live. Then we sent the san...

I Learned the Hard Way: Data Migration Isn't What I Thought It Was
Programming Aug 19

I Learned the Hard Way: Data Migration Isn't What I Thought It Was

Three years ago, I was asked to help move customer data from an old CRM into a shiny new system. I thought I had this, extract some SQL, transform it, load it, done. I was confidently wrong. Six weeks later, staring at a production issue where 47 customer records had split into du...