Skip to content

fix(validate): colour validation misses component-level colour fields #116

Description

@LeadcodeDev

Surfaced while implementing #110 (wave 2 of #102).

Wave 2 made unresolvable colours fail validation, but only for Color-typed fields in CssStyle — the ones paint_pass resolves through parse_css_color.

Component-specific colour fields are plain String and go through parse_hex_color's more lenient path, so they are not covered:

Kbd.background_color, Table.header_color, Marquee.color, Notification.accent_color, Badge.dot_color, chart series colours, Glow.color, and the roughly forty other *_color fields the audit counted living outside style.

An unresolvable colour in any of those still reaches the renderer, where it now paints magenta (wave 1) rather than black — loud, but only discovered after rendering.

Fix: route the component-level colour fields through the same validation. Consider whether they should be Color-typed rather than String in the first place, which would make the whole class impossible to get wrong.

Acceptance: an unresolvable colour fails validation wherever it appears, not only inside style.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions