[Link/SegmentedButton]: [SF][A11y] Styling and focus issue of Segmented buttons and Link in Windows High Contrast theme
Describe the bug
When we apply High contrast theme in windows system using following 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
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
- Open storybook link for segmented button and observe that the buttons are not styled correctly
- 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,
- Styling for the segmented button should be correct
- Link focus should be clearly visible
Screenshots or Videos
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.
Thanks for reporting! I'll forward this issue to our UI5 Web Components Colleagues as the affected component is developed in their repository.
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
Hey @SAP/ui5-webcomponents-topic-core,
This issue is the same as https://github.com/SAP/ui5-webcomponents/issues/9436
Best regards, Boyan
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.