Closed malisipi closed 1 week ago
Thank you for the suggestion. Yes it's a good point, but the issue is on Linux the WebUI library may depend on GTK (dev)... I'm not sure yet. Another thing is I don't know if all web browsers support this or not, let's test and see.
Edge and Chrome is supporting the high contrast mode as I tested. However I am pretty sure about most of Chromium browsers and Firefox are supporting that by default. We should a flag to disable high contrast support.
To make WebUI independent, we can read GTK and KDE config files about the theme and if we detect high contrast enabled, we can report it to the application to disable or change CSS.
I would work about the API support.
I can disable High Contrast support for Chrome, Firefox and Edge (and probably other untested chromium browser).
Firefox | Chrome | Edge |
---|---|---|
Chromium browsers disable the feature by adding a command line flag however Firefox requires a change on profile. So I created a new profile for Firefox by adding "-NoHC" suffix.
Now, I need to implement OS high contrast theme detection.
Motivation
Most of browsers has a high contrast mode that enables if OS is themed by a high contrast theme. Supporting browsers default behavior is good for most usage cases however some devs might want to create custom high contrast theme to ensure high contrast theme is not breaking some UI. Because auto-theming is not working fine for all web applications. It has some problems;
Description
So WebUI needs a option to detect and change behavior of browser about high contrast. It may help give more accessibility for users and more freedom for developers.
Example code
I wrote some API examples for this situation. (API names and behavior should be re-considered to save consistent.)