Describe the bug
It is possible to set the default-color for a text-area (faktaruta) for the tool "Dokumenthanterare 2.0".
It is also possbile to override the colors for each document in the editor "Dokumenthanterare 2.0"
When using any of these settings the toggling of dark/light mode is broken, e.g the colors are not changing.
To Reproduce
Steps to reproduce the behavior:
Global colors
Go to the tool Dokumenthanterare 2.0 and change colors in the colorpickers for "Faktaruta"
Open the map with the tool activated
Toggle between dark and light mode
Overridden colors
Go to the editor Dokumenthanterare 2.0 and create a "faktaruta" for a section of text
Set custom colors (data-background-color and data-divider-color)
Open the document in client
Toggle between dark and light mode
Expected behavior
The colors should switch when toggling between dark and light mode.
This is kinda tricky because the administrator can set any color and it is difficult to programatically
"find" contrasting colors when toggling dark and light mode.
Might be able to fix this with the function getContrastingColor in MaterialUI but it needs investigation.
Currently dark and light mode is only working if no custom colors are set.
Screenshots
Desktop (please complete the following information):
Any browser
Smartphone (please complete the following information):
Any browser and device
Additional context
Add any other context about the problem here.
Describe the bug It is possible to set the default-color for a text-area (faktaruta) for the tool "Dokumenthanterare 2.0". It is also possbile to override the colors for each document in the editor "Dokumenthanterare 2.0"
When using any of these settings the toggling of dark/light mode is broken, e.g the colors are not changing.
To Reproduce Steps to reproduce the behavior:
Global colors
Overridden colors
Expected behavior The colors should switch when toggling between dark and light mode. This is kinda tricky because the administrator can set any color and it is difficult to programatically "find" contrasting colors when toggling dark and light mode.
Might be able to fix this with the function getContrastingColor in MaterialUI but it needs investigation. Currently dark and light mode is only working if no custom colors are set.
Screenshots
Desktop (please complete the following information): Any browser
Smartphone (please complete the following information): Any browser and device
Additional context Add any other context about the problem here.