Duolith docs

Warnings while reading a page

W0003 Text too close to its background

Message text-text on bg-background has a contrast of ratio:1 in scheme mode; this text needs needed:1

Words in italics are filled in when the compiler reports it, such as the element's name or the list of known ones.

Why

Text must stand out from its background to be read in sunlight, on a dim screen or with low vision. WCAG 2.1 asks for 4.5:1, or 3:1 for large text (24px, or 18.66px bold). The check uses the theme's token values in each colour scheme the app shows, with the nearest text- and bg- utilities that always apply.

How to fix it

Use a text colour and background further apart, such as text-ink on bg-surface, or change the tokens in theme.yaml.

In a terminal

duolith explain W0003

Mentioned in