In the AppStore you can find a widget named EnumClass.
With this widget you can give an element a certain class based on a string, enum or boolean.
In SASS you can then define colors based on that class (see here for an example).
Thx Stephan,
I think this widget sound smore like what we will need.
https://appstore.home.mendix.com/link/app/106033/
"StyleSheetSwitcher
Change the styling of your application based on application logic."
If you really need dynamic sass you might have a look at the
This is dynamically generating the css and using that.