我正在寻找如何更改它,但似乎没有一个解决方案对我有用。
我想覆盖 react-bootstrap 按钮的颜色。
下面的这个解决方案工作得很好,正是我想要做的:
<Button
block
style={{backgroundColor: '#0B0C10', borderColor: '#45A293', color: '#45A293', borderRadius: '100px'}}
>
sample text
</Button>
但我不想每次使用按钮时都重写它,所以我想用 css 解决,我试过使用这个:
.custom-button {
background-color: #1F2833;
border-color: #45A293;
border: 3px solid-transparent;
color: #45A293;
border-radius: 100px;
}
然后像 className="custom-button" 一样在 className 中传递它,但它并没有真正起作用。
我正在使用 react-bootstrap 中的 Button
import {Button} from "react-bootstrap";
来自引导程序的样式
import 'bootstrap/dist/css/bootstrap.min.css';
使用版本如下:
"react-bootstrap": "^1.0.0-beta.5",
"bootstrap": "^4.3.1",