Reputation: 213
How can I change the color of thing tick inside a checkbox? This is what I have done:
.ant-checkbox-checked .ant-checkbox-inner {
color: #000000;
background-color: #008000;
}
.ant-checkbox-checked .ant-checkbox-input {
color: #000000;
background-color: #000000;
}
Upvotes: 1
Views: 4682
Reputation: 91
Well, if someone still want to know the answer in 2023. For antd v5, you would add prefixCls
prop in the Checkbox
component like this
<Checkbox
prefixCls="show-error"
...other props>
{`ShowError`}
</Checkbox>
Then in your CSS file, you would add
.show-error-wrapper-checked > .show-error > .show-error-inner {
background-color: #ff4d4f !important;
border-color: #ff4d4f !important;
}
.show-error-wrapper > .show-error:hover > .show-error-inner {
border-color: #ff4d4f !important;
}
Importantly, don't forget to add !important
in your code, and that won't be any caveats of adding it here, since the class name is unique.
Upvotes: 0
Reputation: 2042
Add this css to your styles:
.ant-checkbox-checked .ant-checkbox-inner:after {
border-color: red !important;
}
Upvotes: 4