The optional getCss loader option is serialized into the generated module, so it must be a self-contained function without closed-over variables.
The Style Text Obsidian plugin allows to create as many CSS Styles as you wish: Then, they will be available to be applied to the selected text in the editor via Commands (Command Palette): Each ...