Removing hover effect in ant-checkbox #36678
Answered
by
valcosmos
Saicharan0662
asked this question in
Q&A
-
Can we remove the blue hover effect in the ant-checkbox. I tried to remove using CSS but no progress. |
Beta Was this translation helpful? Give feedback.
Answered by
valcosmos
Jul 25, 2022
Replies: 2 comments 1 reply
-
Hello, I tried this, it does work. Hope it can help u. In import { useState } from 'react'
import { Checkbox } from 'antd'
import 'antd/dist/antd.css'
import './App.css'
import type { CheckboxChangeEvent } from 'antd/es/checkbox';
function App() {
const onChange = (e: CheckboxChangeEvent) => {
console.log(`checked = ${e.target.checked}`)
}
return (
<div className="App">
<Checkbox onChange={onChange}>Checkbox</Checkbox>
</div>
)
}
export default App In .ant-checkbox-wrapper:hover .ant-checkbox-inner,
.ant-checkbox:hover .ant-checkbox-inner,
.ant-checkbox-input:focus + .ant-checkbox-inner {
/* border-color: #1890ff; */
border-color: #d9d9d9 !important;
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Saicharan0662
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, I tried this, it does work.
Hope it can help u.
In
App.tsx
In
App.css