Skip to content

MessageViewButton: Critical state fails WCAG 1.4.3 contrast (3.36:1, requires 4.5:1) #9092

Closed

Description

@bennylalala

Describe the bug

The MessageViewButton component rendered with type={ValueState.Critical} (orange state) fails WCAG 1.4.3 Minimum Contrast (Level AA).

Background: --sapButton_Critical_Background → #e76500 (rgb(231, 101, 0))
Text color: --sapButton_Critical_TextColor → #ffffff
Measured contrast ratio: 3.36:1
Required ratio: 4.5:1 (normal text, 14px / 400 weight)
The counter number rendered inside the button (e.g. 5) is displayed as white text on this orange background, producing a contrast ratio of 3.36:1 which fails the WCAG 2.1 AA threshold of 4.5:1 for normal-sized text.

This was validated and confirmed in the Storybook at https://ui5.github.io/webcomponents-react/v2/?path=/story/user-feedback-messageview--with-message-view-button.

Isolated Example

No response

Reproduction steps

  • Render a MessageViewButton with type={ValueState.Critical} and a non-zero counter prop
  • Inspect the rendered ui5-button host element's computed background color → rgb(231, 101, 0)
  • Inspect the counter text color → rgb(255, 255, 255)
  • Calculate contrast ratio: (1.05) / (0.2631 + 0.05) = 3.36:1 — fails WCAG 1.4.3

Expected Behaviour

The text color on the Critical-state button should achieve at least 4.5:1 contrast against the orange background, or the background color should be darkened to meet the threshold. Either --sapButton_Critical_Background or --sapButton_Critical_TextColor (or both) must be adjusted.

Screenshots or Videos

No response

UI5 Web Components for React Version

2.27.2

UI5 Web Components Version

2.27.2

Browser

Chrome

Operating System

No response

Additional Context

The colors are sourced from SAP Fiori design tokens in @sap-theming/theming-base-content, specifically in content/Base/baseLib/sap_horizon/css_variables.css:

--sapButton_Critical_Background: #e76500;
--sapButton_Critical_TextColor: #fff;
This may need to be cascaded as a bug report to SAP/theming-base-content, as the non-conformant contrast pair originates there. MessageViewButton.module.css correctly uses these tokens via var(--sapButton_Critical_Background) / var(--sapButton_Critical_TextColor) — no hardcoded colors in @ui5/webcomponents-react.

Relevant log output

Organization

SF

Declaration

  • I’m not disclosing any internal or sensitive information.

Activity

  1. added theissue type on Oct 23, 2026
  2. Lukas742 commented on Oct 23, 2026

    @Lukas742
    Contributor

    Hi @bennylalala

    The contrast ratio for these value-state buttons is ensured by the text shadow, which is part of the design specification — the same mechanism used by Badge, ObjectStatus, and similar semantic components. A plain foreground-vs-background calculation (white text on --sapButton_Critical_Background) therefore doesn't capture the full picture; the contrast has to be evaluated with the --sapContent_ContrastTextShadow applied on top of the white text color. So from our side this is working as designed.

    Image

    That said, while looking into this I did notice a few minor deviations from the design spec in MessageViewButton, which I've corrected in #9094. These are unrelated to the contrast ratio, they just bring the styling in line with the spec.

    If you believe the specified contrast is still insufficient, that would be a matter for SAP Design.

    I'll close this issue for now, but don't hesitate to reach out if you have any further questions or feedback!

  3. changed the issue type fromtoon Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions