Not sure if I totally understand what you want but you can change the values of CSS variables through code by setting inline styles on components, via setStyle method.
Pardon the publicity but yesterday I just happened to mention exactly that on one of my posts and might help you: https://pixelduke.com/2018/10/14/fxribbon-version-1-2-released/ -- Pedro Duque Vieira - https://www.pixelduke.com