This widget may be of use to you. https://appstore.home.mendix.com/link/app/109716/
I have personally used this one: works like a charm. https://appstore.home.mendix.com/link/app/106033/
Use the javascript button, set the following javascript:
document.getElementById("content").classList.toggle("dark-theme")
Make two sets of colorpalets:
#content{
--background-color: #fff;
--font-color: #000;
}
And
#content .black-theme{
--background-color: #000;
--font-color: #fff;
}
Then create your buildingblocks and refer to de variables you've set:
.buildingblock{
background-color: var(--background-color);
font-color: var(--font-color)
}
Check this blog post: https://www.notion.so/gajduk/How-to-add-a-dark-theme-to-your-Mendix-app-in-5-minutes-27ea7559165b46e3a3aac2f19cef8836