Theme classes, like md-warn should be applicable to any element.
span and apply any of the theme color classes.The element is colored according to the theme.
It isn't.
The declared theme should affect all areas of the application that the developer sees fit. The current behavior forces them to duplicate functionality, by creating additional styles which aren't under control of the AngularJS Material theming support.
Seems like it gets complicated when trying to apply a style conditionally. 馃
In my current approach (with custom CSS), I was simply using
ng-class="{'md-warn': vm.shouldWarn}"
I replaced that with
md-colors="{'color' : '{{vm.shouldWarn ? 'warn' : ''}}'}"
But now I get an error mdColors: couldn't find '' in the palettes. in the case where the style shouldn't be applied.
Here's a demo where there are two examples
md-colors is used$mdColors.getThemeColor('warn') is usedWhich style to pick depends upon how much logic you want in your template.
Awesome. Thank you so much for your effort.