[英]How can I override form-control class from a reactstrap input?
I have a reactstrap Input and I have the following issue: I need to override.form-control class or disable it, because otherwise my styles from styles.module.scss are not applied.我有一个 reactstrap 输入,我有以下问题:我需要覆盖.form-control class 或禁用它,否则我的 styles 来自 styles.module.scs How can I achieve this?
我怎样才能做到这一点? I tried different specificity solutions but I can't get over.form-control class.. because I think it's computed last and overrides all my styles.
我尝试了不同的特异性解决方案,但我无法克服。form-control class.. 因为我认为它是最后计算的,并覆盖了我所有的 styles。 If I put inline styles, it's ok, my styles are applied but this is not good practice, so I need to find a solution to apply my style from styles.module.scss.
如果我放入内联 styles,没关系,我的 styles 被应用,但这不是好的做法,所以我需要从 styles 中找到一个解决方案来应用我的样式。 Any ideas?
有任何想法吗?
<Input
style={{
fontSize: '18px',
backgroundColor: 'ffffff',
boxShadow: 'none',
outline: 'none'
}}
type={'textarea'}
id="clientInfo"
name="clientInfo"
defaultValue={formatValue(value)}
/>
You can use !important
keyword to apply your custom style into .form-control
class.您可以使用
!important
关键字将自定义样式应用到.form-control
class。
Your input field:您的输入字段:
<Input
className='form-control'
type={'textarea'}
id="clientInfo"
name="clientInfo"
defaultValue={formatValue(value)}
/>
Your CSS file:您的 CSS 文件:
.form-control {
fontSize: 18px !important;
backgroundColor: #ffffff !important;
boxShadow: none !important;
outline: none !important;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.