Hi,
Maybe using dynamic classes would be an option for you?
https://docs.mendix.com/refguide/common-widget-properties/#dynamicclasses
Or you could make the button call a nanoflow instead of a microflow. The nanoflow can have a “call javascript action” and then a “call microflow action”. Although i have little experience with this last option, it appears to be a valid way to approach this.
I hope this helps,
Michiel