I'm using antd radios and checkboxes. I want to give custom colors to them. I found answer about checkbox but found no way to change radio button color.
Is there any way to do so?
I'm using antd radios and checkboxes. I want to give custom colors to them. I found answer about checkbox but found no way to change radio button color.
Is there any way to do so?
You can achive it by overriding following css classes:
.ant-radio-checked .ant-radio-inner{
border-color: red !important ;
}
.ant-radio-checked .ant-radio-inner:after{
background-color: red;
}
.ant-radio:hover .ant-radio-inner {
border-color: red ;
}
First block is responsible for coloring the circle around the dot in radio. You can ignore !important rule but then you have to override :focus selector like:
.ant-radio-checked .ant-radio-inner:focus{
border-color: red;
}
Second block color the dot in the middle of selected radio. The last one color circle on hover. I am not completely sure why ant-radio-inner should be inside radio:hover, but it works for me.
© 2022 - 2024 — McMap. All rights reserved.