0

I want to change the color of my radio buttons. I found some examples and tried them, but it never worked. I dont know if I'm doing it wrong, but I tried these examples like this:

Example 1

HTML

<md-radio-button class"radio-button"> yes <md-radio-button>

CSS

//checked
.radio-button md-radio-button , md-radio-button.md-checked ._md-on{
   background-color: blue;
 }

Example 2

HTML (same as above)

CSS

md-radio-button.md-default-theme.md-checked .md-on, md-radio-button.md-checked .md-on{
background-color: blue;
}

I simply just want to change the color but all the examples I tried didnt work. Do I have to change the color of the mat-radio-inner-circle? If so, how?

BlueCat
  • 673
  • 4
  • 16
  • 27
  • Possible duplicate of [How do I change the color of radio buttons?](https://stackoverflow.com/questions/4253920/how-do-i-change-the-color-of-radio-buttons) – KyleS Jun 26 '17 at 12:58
  • I've seen this too, but this was posted almost 7 years ago... So i'm not sure if this is still correct. And I saw other examples, where they changed the color, but when I try these it never works. Maybe there wasn't the possibility to change the color 7 years ago but i think now it should work. I guess I'm doing it just wrong and so I hope someone can help me lol – BlueCat Jun 26 '17 at 13:03

1 Answers1

0

Try the following code, change your own color inside rgba() !important;

md-radio-button.md-default-theme:not([disabled]).md-primary .md-on, md-radio-button:not([disabled]).md-primary .md-on, md-radio-button.md-default-theme:not([disabled]) .md-primary .md-on, md-radio-button:not([disabled]) .md-primary .md-on, md-radio-group.md-default-theme:not([disabled]).md-primary .md-on, md-radio-group:not([disabled]).md-primary .md-on, md-radio-group.md-default-theme:not([disabled]) .md-primary .md-on, md-radio-group:not([disabled]) .md-primary .md-on {
background-color: rgba(16,108,200,0.87) !important; }