Skip to content

Unstable items in rustdoc fail WCAG color contrast criterion #93393

Closed
@GKFX

Description

@GKFX

https://doc.rust-lang.org/core/intrinsics/index.html has a long list of unstable functions. They have a text colour of #9a6e31, and due to the unstable class on their parent an opacity of 0.65. This results in text with too little contrast against their background to be read by all users.

Firefox can't use the opacity of parent elements to calculate colour contrast, but if I move the opacity into the text colour I calculate a ratio of 2.46:
Screenshot from 2022-01-27 22-32-28

This is much less than the recommended minimum value of 4.5 (WCAG 1.4.3). The little unsafe triangle is even fainter as it starts pale and is then also made 65% opaque. The contrast should be increased. This might be by removing the opacity rule and indicating instability by a symbol, or some other means.

It might be worth lumping this issue into #59845, but as it's quite specific I thought I'd file it as its own issue initially.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions