Duolith docs

Warnings while reading a page

W0061 Colour written out where a token has it

Message value is written out, but the theme has a token for it

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

Why

A colour written as a hex value in a style block or an image's placeholder stays the same in dark mode and when the theme changes. The theme's token of that value follows both.

How to fix it

Write the token instead, var(--color-name) in a style block or the token's name in a placeholder. duolith lint --fix does where exactly one token has that value in the light scheme (the dark one, for a theme that is always dark); where several share it, choose the one the colour stands for.

In a terminal

duolith explain W0061

Mentioned in