How to set text color in Angular-Material?

前端 未结 9 1517
被撕碎了的回忆
被撕碎了的回忆 2020-12-30 19:20

I want to set one word in a sentence to have md-primary color, and another word to have the accent color. I assumed something like this:

Hel
相关标签:
9条回答
  • 2020-12-30 19:39

    This answer is outdated please check @factalspawn answer

    With 'pure' angular-material you can't. But you can try usign this: https://gist.github.com/senthilprabhut/dd2147ebabc89bf223e7

    0 讨论(0)
  • 2020-12-30 19:41

    The latests bits bring good news to this issue... This functionality has been added to the 1.1.0-rc3 (2016-04-13) version. It's not stable yet, but my first test on it are satisfactory.

    Now you can use the mdColors directive and $mdColors service in conjunction with themes to achieve what you're looking for.

    Please, take a look at:

    https://github.com/angular/material/blob/master/CHANGELOG.md#110-rc3-2016-04-13

    to see the announcement, and look for the mdColor directive and $mdColor service in the docs for some examples.

    0 讨论(0)
  • 2020-12-30 19:42

    Anchor element () is reacting to the Angular Material current theme setting since version 1.0.0-rc1: https://github.com/angular/material/blob/master/CHANGELOG.md#110-rc1-2016-03-09.

    0 讨论(0)
提交回复
热议问题