Hi Jochem,
You can use JavaScript Actions for this. Here is a possible solution:
// BEGIN USER CODE document.body.className = styleClass; // END USER CODE
This should be a simple solution to your question.
Hope this helps!
Hi
In the latest versions of mendix specially after 11th it's a bit different.
So, If you go and look in the app module > styling > web
you will see two files
The theme-dark.scss conains root variables for dark theme for example
:root.theme-dark {
--color-base: rgb(30, 30, 30);
--color-contrast: #ffffff;
}
step 1 - Just need to update the variable values inside this file as per your requirement.
step 2 - Just need to trigger a nanoflow which calls a JS_action which will do add the class to the document like
document.documentElement.classList.add("theme-dark");