ui5-webcomponents icon indicating copy to clipboard operation
ui5-webcomponents copied to clipboard

[Link/SegmentedButton]: [SF][A11y] Styling and focus issue of Segmented buttons and Link in Windows High Contrast theme

Open Ankitadoshi opened this issue 2 years ago • 4 comments

Describe the bug

When we apply High contrast theme in windows system using following steps:

  1. Select Start then Settings then Ease of Access then High contrast
  2. Turn on the toggle under Turn on high contrast
  3. Select a theme from the drop-down menu
  4. Select Apply

Then the styling for segmented buttons is not proper. Also when we focus on Link elements, the focus styles are not clearly visible

Isolated Example

https://sap.github.io/ui5-webcomponents-react/v2/?path=/story/data-display-link--default&globals=theme:sap_horizon_dark, https://sap.github.io/ui5-webcomponents-react/v2/?path=/story/inputs-segmentedbutton--default&globals=theme:sap_horizon_dark

Reproduction steps

1.Turn on Windows High contrast theme by following below steps:

  • Select Start then Settings then Ease of Access then High contrast
  • Turn on the toggle under Turn on high contrast
  • Select a theme from the drop-down menu
  • Select Apply
  1. Open storybook link for segmented button and observe that the buttons are not styled correctly
  2. Open storybook link for the Link and focus on the link via tab key. Observe that the focus is not clearly visible

Expected Behaviour

In windows HC themes,

  1. Styling for the segmented button should be correct
  2. Link focus should be clearly visible

Screenshots or Videos

Screenshot 2024-09-20 at 3 14 56 PM Screenshot 2024-09-20 at 3 14 36 PM

UI5 Web Components for React Version

latest

UI5 Web Components Version

latest

Browser

Chrome

Operating System

Windows

Additional Context

No response

Relevant log output

No response

Organization

SF

Declaration

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

Ankitadoshi avatar Sep 20 '24 09:09 Ankitadoshi

Thanks for reporting! I'll forward this issue to our UI5 Web Components Colleagues as the affected component is developed in their repository.

Lukas742 avatar Sep 20 '24 13:09 Lukas742

Hello @ui5-webcomponents-topic-b , I am not sure this is a supported scenario, but I am forwarding this ACC issue to you, so that ACC experts can decide.

When using High Contrast Theme on Windows machine with sap_horizon_dark theme SegmentedButton and Link do not have correct styles, including when focused.

To reproduce:

  • on a Windows machine: Settings > Accessibility > Contrast themes --> choose one from the drop-down menu and click Apply button then open the samples links, mentioned above.

Regards, Iliana

IlianaB avatar Sep 20 '24 13:09 IlianaB

Hey @SAP/ui5-webcomponents-topic-core,

This issue is the same as https://github.com/SAP/ui5-webcomponents/issues/9436

Best regards, Boyan

unazko avatar Sep 24 '24 09:09 unazko

Hello @Ankitadoshi @Lukas742

Have a look at this PR addressing another but duplicate issue, except that it's about the UI5 Web Components Docs, not the UI5 Web Components 4 React Docs as in the current issue: https://github.com/SAP/ui5-webcomponents/pull/10085

The common part between the two issues is that Windows Contrast themes adjust colors of UI5 Web Components which leads to poor visual. And there is this CSS solution to opt out from this forced colors mode as known and it's to set forced-color-adjust: none for your page:

html {
    forced-color-adjust: none;
}

We will fix this for the UI5 Web Components samples (@Lukas742 same could be done for the UI5 Web Components 4 React samples). However, applications should set this on their own, as UI5 Web Components is not an application framework and does not own the page, so same we recommend in your application pages. Also, it's more flexible to leave this to the applications to decide to opt out or not from the forced colors mode.
And, at the end we offer HCB and HCW themes that are recommended to be used for these cases and built exactly for these cases. Learn how to detect the OS Preferences (f.e. when Windows constrast theme is used) and set HCB and HCW themes when needed in the Theme Selection According to OS Settings article.

ilhan007 avatar Oct 25 '24 12:10 ilhan007