-
-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BasicUI] CurrentColor in SVG depends on browser mode preference, not on the theme selected in the settings #1861
Comments
What browser are you using? |
I am using Firefox 112/Linux Desktop. |
Look at this message: #1743 (comment) In the current version, the icons provided by openHAB server are displayed using the img tag and their colors cannot be adjusted. |
I do not know whether the icons on the link mentioned have |
No but they have currentColor. |
With the file, mentioned in the first comment here, if I create an html file with the content: <html style="color-scheme: light dark"><body>
ABC
<img src="office_phone.svg">
</body></html> then the colors change, whenever I change the browser's dark/light mode. So in this particular case it is irrelevant, if the image is inserted as What I am saying is tha probably Basic UI does not utilize |
Yes, that is very probable. |
In openHAB 3.4.3 when the top most |
In MainUI or BasicUI? Do you suggest to set color-scheme depending on the OH theme? |
Does it work if color-scheme style is applied to the img tag? |
Final test by setting color-scheme in CSS when handling OH themes. Still icon in black. |
I should have started by that ! I tried with a similar HTML file as yours:
Here is the content of mic.svg:
With this HTML
So I have apparently not the same result as you, the img is not impacted by color-scheme. |
Unless I said MainUI, I mean here BasicUI.
I suggested
My SVG file has in the |
But it works with YOUR SVG file ! Maybe because your SVG includes the color-scheme ? |
So I can do the change but it will work only for a very limited number of SVG files ? |
Yes an no. If users want to have adaptive black/white in SVG and can have it by adding Probably the number of SVGs with |
to have icon color depending on selected theme Fix openhab#1861 Will work only with SVG custom OH icons containing style="color-scheme: light dark" and currentColor as fill color. Signed-off-by: Laurent Garnier <lg.hc@free.fr>
to have icon color depending on selected theme Fix #1861 Will work only with SVG custom OH icons containing style="color-scheme: light dark" and currentColor as fill color. Signed-off-by : Laurent Garnier <lg.hc@free.fr>
The problem
In openHAB 3.4.2 I upload in /etc/openhab/icons/classic the file office_phone.svg:
and define an item:
which is then included in a sitemap.file
When my browser is setup to prefer dark mode pages, the currentColor from the SVG file is rendered as white. When my browser is setup to prefer light mode pages, it renders the currentColor in the SVG as black.
Under https://openhab-uri/settings/services/org.openhab.basicui I can change the Theme between «Default» and «Dark», but it does not change the background color. My understanding is, that BasicUI does not utilize the CSS property
color-scheme
.The text was updated successfully, but these errors were encountered: