Use :global {}
- The introduction of CSS
import styles from './index.less'
Copy the code
- Use the class name on the tag
const someComponents = () = > {
return (
<div className={styles.radioBox}>
<Radio/>
</div>)}Copy the code
- CSS File Contents
- What radioBox does is just wrap this change around and it only works in radioBox
- Premise: The ant-radio-inner class is defined globally
.radioBox {
:global {
.ant-radio-inner {
border: 1px solid # 666 ! important; }}}Copy the code