Search code examples
angularjsfocusangular-material

How I can change the md-select text color?


I am using angular material in my website and I want to change the md-select color on focus. Can someone please help me with the classes I need to use to change its color?

I tried something like this

md-select {
  color: blue;
}

Also I want to change its placeholder color.


Solution

  • How can I change the md-checkbox-text color

    Like this

    <md-checkbox class="green">
       Green Checkbox
    </md-checkbox>
    
    md-checkbox.md-checked.green .md-icon {
     background-color: rgba(0, 255, 0, 0.87);
    }
    

    http://plnkr.co/edit/qc2tdr0VqCtbnpc0O4Y2?p=preview

    As for ng-select, it turns out if you inspect the DOM, the placeholder attribute is a span element. To select it, you should use the CSS descendant selector

    .md-select span {
        color: blue;
    }
    

    Source

    https://material.angularjs.org/0.11.2/#/CSS/checkbox