【发布时间】:2019-08-08 11:43:53
【问题描述】:
嗨,我在反应中使用样式化组件
const H4 = styled.h4`
font-size: 15px;
letter-spacing: 0.38px;
line-height: 1.33;
color: red;
padding: 20px;
`;
<H4>Small header</H4>
它将在 H4 标签中给出精确的样式。但是我怎样才能用m-b-10之类的实用程序类覆盖这个填充它会给margin-bottom:10px
类似<H4 m-b-10>small header</H4>
同时我需要在任何我想要的地方使用这个实用程序类。在 css 中我可以简单地写
m-b-10{margin-bottom:10px !important};
如何在样式化组件上实现这一点?
【问题讨论】: