WCAG Contrast and Font Size Implementation

Note: when a visually impaired user cannot read text on your site due to insufficient contrast, it's not just poor UX — it's a direct threat of lawsuits. WCAG 2.1 AA has become the de facto standard (see [Web Content Accessibility Guidelines](https://en.wikipedia.org/wiki/Web_Content_Accessibility_G

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:

Frequently Asked Questions

Latest works

  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1281
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1237
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    977
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    1025
  • image_website-sbh_0.webp
    Website development for SBH Partners
    1103
  • image_website-_0.webp
    Website development for Red Pear
    550

Note: when a visually impaired user cannot read text on your site due to insufficient contrast, it's not just poor UX — it's a direct threat of lawsuits. WCAG 2.1 AA has become the de facto standard (see Web Content Accessibility Guidelines): a minimum contrast ratio of 4.5:1 for normal text and 3:1 for large text (18pt regular or 14pt bold). WCAG contrast is one of the most common problems we fix. Font size and accessibility are tightly linked: large text allows lower contrast. We have conducted over 50 accessibility audits (5+ years of experience) and know how to bring your contrast and fonts to compliance without rewriting all CSS. Time savings on manual checks can reach 70%, and you avoid significant legal risks. Audit pricing depends on project scope and is available upon request.

Problems with Contrast and Fonts

A typical mistake is using a single accent color for text on all backgrounds. Even designers from major brands sometimes allow a contrast of 2.8:1 for input field hints or 2.1:1 for disabled buttons. Gradients, semi-transparent overlays, and hover states are especially tricky — automated tests often miss them.

We combine automated (Pa11y, Axe) and manual methods for checking. Automation catches up to 80% of errors, but the remaining 20% require a human eye. Compare the key approaches:

Method Coverage Time per page Misses
Auto (Pa11y with WCAG2AA) 70–80% 2–5 seconds Gradients, text on images, animations
Manual (Axe + visual inspection) 95%+ 10–15 minutes Rare states, complex backgrounds

Most Effective Contrast Checking Tools

For a quick pair-of-colors measurement, the WebAIM Contrast Checker is a handy online tool that shows the ratio and AA/AAA level. For mass auditing, we use Pa11y with a custom config. We embed a check for every page into the CI pipeline — if any page fails, the build breaks.

npx wcag-contrast "#333333" "#ffffff" # 12.63:1 — excellent 

Note: online contrast checking must account for states too. For that we use Axe Core with WCAG 2.1 AA configurations.

How We Achieve WCAG AA Compliance in 5 Days

The process consists of five steps:

  1. Audit — run Pa11y and Axe on all pages, visually inspect complex states.
  2. Design — create semantic CSS variables that guarantee contrast.
  3. Implementation — replace colors with variables, correct fonts and spacing.
  4. Testing — re-run automated tests and manually verify key screens.
  5. Deploy and train — integrate CI check, hand over documentation and configs.

This approach is 4 times faster than chaotic manual fixing of each element. For example, on an e-commerce project, an automated test missed a card with a contrast of 4.1:1 on a gray background — we darkened the text color and documented a new token. Result: contrast became 4.6:1, and the entire design system updated in one day.

Design System and CSS Variables

What to do when contrast fails in a design system?

Typical scenario: the token --color-text-muted gives a contrast of 4.2:1 instead of 4.5:1. The solution is either darken the color or increase the font size to large. We recommend the first: change the color in one place, not the size on every component.

Example fix:

:root { --color-text-primary: #1a1a1a; /* 17.1:1 AAA */ --color-text-secondary: #595959; /* 7.0:1 AA */ --color-text-muted: #767676; /* 4.54:1 AA */ --color-accent: #005EA2; /* 5.9:1 AA */ } 

Was #808080 (4.0:1) → became #767676 (4.54:1). A 10% brightness change solved the problem.

Automating Checks in CI

To prevent contrast from breaking on every commit, we integrate Pa11y into GitHub Actions.

// .pa11yrc.json { "standard": "WCAG2AA", "runners": ["axe", "htmlcs"], "ignore": ["color-contrast"] } 

The pipeline stops the build if any check fails — the defect never reaches production.

Results and Guarantees

Systematic WCAG implementation pays off in 3–6 months through savings on checks and absence of lawsuits. Compare approaches:

Approach Implementation cost Fine risk Maintenance time
Chaotic fixes Low High High
Systematic audit + CI Medium Minimal Low

Timeline: from 3 to 5 working days for an average-sized project. We specify exact timelines after reviewing your code.

What Our Work Includes

  • Full audit of contrast for all UI states (normal, hover, focus, disabled) on 2–3 different backgrounds.
  • Audit of font sizes and line heights on desktop and mobile.
  • Creation or refinement of a design system (CSS variables, documentation).
  • Integration of Pa11y into your project's CI.
  • Team training: how to check contrast in Figma and DevTools.
  • Guarantee: if a new page fails AA after our tokens are applied, we fix it for free.

With over 100 projects completed and a 5-year track record, we bring proven expertise to your accessibility journey. Contact us to audit your project. Order a free check of 5 pages — see the quality of our work.