Dynamically changing element style/css

I want to create an element which style is dynamically changed based on entity attributes. This should allow for a fully dynamic style, so using an enumeration or classes won’t work. A simple use case would be to change buttons color to a hex value specified by the user in a text input field. I know this question has been asked before, but unfortunately this answer no longer works. What would be the best way to achieve this? Is there a way to make it work for advanced css selectors like :hover or ::after? What about keyframe animations? I would be very grateful for any help regarding this.
3 answers

In MX Studio you can call a javascript action in a nanoflow. You will ofc need a user action or dataview to call the nanoflow.



You can still use the mxui/dom client api to find and manipulate dom elements.



For simple stuff you could use the css selector helper widget: https://appstore.home.mendix.com/link/app/35039/

This will help you set styling based on enums, booleans etc.


Is this possible for Mendix native? Can I change the css of an app with the help of a javascript action? For example the font size on click of a button?