# Running Lighthouse turned up 3 real WCAG contrast bugs

> An Accessibility score of 96 looked fine, but running Lighthouse showed footer text at a 1.37:1 contrast ratio, nearly invisible in dark mode.

- Date: 2026-07-17
- Topics: Accessibility
- Chinese original: https://kbs0830.com/blog/lighthouse-wcag-contrast

"Find time to run Lighthouse" is the kind of to-do item that keeps getting pushed back, because the score "should be fine". When I finally ran it, I learned that a 96 in Accessibility was hiding 3 problems that really do make content invisible to some people.

## Look at the LCP breakdown, not just the total

Performance was only 74. Looking at `lcp-breakdown-insight`, the LCP element is the English intro paragraph under the Hero subtitle, with an "element render delay" of 1.75 seconds. The direct cause: the Hero entrance animation has its own `delay` (0.1 to 0.6 seconds) plus a `duration` of 0.8 seconds, and the text only counts as "visually rendered" once the animation finishes. That is a deliberate design choice (the gentle fade-in is the animation language of the whole site), not a bug, so I left it alone. Whether to trade design for score is a question I am still arguing with myself about.

## The 3 Accessibility problems are real bugs

### 1. Footer text contrast was only 1.37:1

`LocalClock.tsx` and `VisitorStats.tsx` (the dual-timezone clock and the visitor stats) used `text-(--border)` as the text color. `--border` is a design token meant for border lines, an extremely low-contrast color. Used as text in dark mode, it gives a contrast ratio of just **1.37:1** (WCAG AA requires 4.5:1 for text). That is not "a bit hard to read", it is nearly invisible. Switching to `text-(--muted)` (the token that exists for secondary text) fixed it.

It taught me something: **the name of a design token is itself documentation**. The name `--border` already says "this is for borders". Using it for text was wrong from the start; it just was not visually obvious enough to catch at a glance.

### 2. The dark-mode accent color missed by a hair

The active state of the tag filter buttons in the portfolio had a contrast ratio of 4.32:1 in dark mode, just short of the 4.5:1 threshold. I nudged `--accent` from `#5b8fc7` to `#6295cc`. The difference is barely visible to the eye, but it moves the ratio from 4.32 to 4.66, which passes.

### 3. The GitHub heatmap image had no `width`/`height`

The embedded third-party GitHub contribution heatmap `<img>` had no explicit size, which causes layout shift (the page content jumps when the image loads). I checked the SVG it actually returns, `width="663" height="104"`, and added those.

## Takeaway

After fixing these 3, Accessibility went from 96 to 100. But more important than the score: before the fix, these problems **really did affect users**, especially the low contrast, which hurts visitors with poor eyesight or anyone using a phone in bright light. "The score is already in the 90s so it should be fine" was my reason for almost skipping the audit, and it turned out that a high score does not mean there are no bugs that make content invisible.

---

Author: PINGWEI LI (李秉威, Li Ping-Wei)
Original page: https://kbs0830.com/en/blog/lighthouse-wcag-contrast
