Black background, gray text: hard to read.

Slop Score flags "Dark mode with muted gray text" on 180 of the 509 sites in its study. What avoids it is one number: give body text a contrast of 7:1 or more.

By @ignapradosTips3 min read

The template dark mode is always the same: a near-black background and body text in a mid gray that "looks refined". In a screenshot it works. Read for a minute, it tires the eyes.

The fix isn't going back to a white background. It's measuring the contrast of every gray you use and raising it until body text clears 7:1.

What Slop Score flags, and how much it weighs

In the November study, covering 509 sites measured under the same rules, Dark mode with muted gray text showed up on 180. It separates less than other signals: 33 of the 63 sites that scored 55 or more have it (52 %), and so do 52 of the 167 that scored under 15 (31 %). Plenty of dark sites are carefully made; the gray of the text is what differs.

Under the hood, Slop Score counts how much of the body text sits on a dark background and how much of that falls below 7:1 contrast. When there is enough of both, it flags the signal and shows you the percentage.

What the guidelines ask for

WCAG 2.2 asks, in success criterion 1.4.3 (level AA), for a contrast of at least 4.5:1 for normal text and 3:1 for large text, which means 18 point or 14 point bold, about 24 and 18.5 pixels. Criterion 1.4.6 (level AAA) raises normal text to 7:1 and large text to 4.5:1.

Passing AA is the floor, and it doesn't take you out of the template: #888888 on #0a0a0a gives 5.58:1 and passes, and it is still that gray. That is why Slop Score uses 7:1 as its line for body text. #999999 lands at 6.95:1, just under.

Measure it, don't eyeball it

The math is WCAG's: the relative luminance of each color and the ratio (L1 + 0.05) / (L2 + 0.05) between the lighter and the darker one. Paste this into your browser console with your two colors:

const lum = (hex) => {
  const [r, g, b] = [1, 3, 5]
    .map((i) => parseInt(hex.slice(i, i + 2), 16) / 255)
    .map((v) => (v <= 0.04045 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4));
  return 0.2126 * r + 0.7152 * g + 0.0722 * b;
};
const contraste = (a, b) => {
  const [x, y] = [lum(a), lum(b)].sort((p, q) => q - p);
  return (x + 0.05) / (y + 0.05);
};
console.log(contraste('#888888', '#0a0a0a').toFixed(2)); // 5.58

With that formula, #888888 on #0a0a0a gives 5.58, #999999 gives 6.95 and #b0b0b0 gives 9.13. A gray only changes how it reads once you measure it.

Three grays with jobs, not ten

Define text in variables, as you would in a custom scale, and keep the lowest gray for what nobody reads closely:

--fondo: #0a0a0a;
--texto: #ececec;       /* reading */
--texto-2: #b0b0b0;     /* secondary: 9.13:1 sobre --fondo */
--texto-3: #999999;     /* labels only, 18 px or larger */
color-scheme: dark;

color-scheme: dark makes the browser paint the canvas, scrollbars and form controls dark, according to MDN. It doesn't change your text color, but it avoids a white field in the middle of a black page.

The working rule: paragraph text uses --texto or --texto-2. --texto-3 is for labels of 18 px or larger and decorative details, not sentences.

Ask your AI tool for it

Without an instruction, the model goes back to muted grays in the next component it builds. Give it the values:

Use a dark theme with three text colors defined as CSS variables: --texto: #ececec for paragraphs and headings, --texto-2: #b0b0b0 for secondary text, --texto-3: #999999 only for labels of 18 px or larger. All reading text must have a contrast of 7:1 or more against its background. Do not use muted grays for paragraphs or opacity below 0.8 on text. Add color-scheme: dark.

Then measure your page again in Slop Score and check whether "Dark mode with muted gray text" still shows up. More ready-to-copy instructions are in the prompt guide.

Sources

Frequently asked questions

What contrast should text have in dark mode?

WCAG 2.2 asks for at least 4.5:1 (level AA) and 7:1 at level AAA for normal text. For long paragraphs, aim for 7:1 or more.

How do you calculate the contrast between two colors?

Compute the relative luminance of each color and apply (L1 + 0.05) / (L2 + 0.05), with L1 the lighter one. The result runs from 1:1 to 21:1.