Closed ByYogi closed 2 weeks ago
可以通过 cx
函数实现以className
实现样式覆写
import { cx,css } from 'antd-style';
const color = 'white'
export default () => (
<div
className={cx(css`
padding: 32px;
background-color: hotpink;
font-size: 24px;
border-radius: 4px;
p {
color: red;
}
.cls2{ color: blue;}
&:hover {
color: ${color};
}
`)}
>
<p>Another</p>
<div class="cls2">Another 2 </div>
Hover to change color.
</div>
)
像Emotion css 可以通过
css
属性覆写 div 里面的p
标签和.cls2
样式; 用 adtd-style 怎么做到这一点?