Skip to content

Unstable items in rustdoc fail WCAG color contrast criterion #93393

@GKFX

Description

@GKFX
Contributor

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.

Activity

added a commit that references this issue on Jan 31, 2023
f75b350
added 2 commits that reference this issue on Jan 31, 2023
382aff1
9e0bfe0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      Participants

      @GKFX

      Issue actions

        Unstable items in rustdoc fail WCAG color contrast criterion · Issue #93393 · rust-lang/rust