changing ToggleButton colors from react-bootstrap(更改Reaction-Bootstrap中的切换按钮颜色)
本文介绍了更改Reaction-Bootstrap中的切换按钮颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的应用程序上有一组ToggleButton,我想更改其背景颜色。目前,我的代码为所有按钮提供了<;。untoggled-Button>;的渐变,而未选中的按钮具有该渐变,并添加了一层蓝色薄膜。我有两个问题:我想要移除未切换按钮上的蓝色薄膜,以及我需要访问切换按钮来更改其样式。<;.toggled-Button>;只是一个目前不执行任何操作的占位符。
我想知道如何访问我的CSS中未选中的和选中的版本的ToggleButton,以覆盖默认的引导样式!
JSX:
<ToggleButtonGroup className="view" type="radio" name="options" defaultValue={2}>
<ToggleButton value={1} className="untoggled-button" > title</ToggleButton>
<ToggleButton value={2} className="untoggled-button"> title</ToggleButton>
<ToggleButton value={3} className="untoggled-button"> title</ToggleButton>
</ToggleButtonGroup>
css(这很不正确,但我希望能够同时设置未选中和选中按钮的样式):
.untoggled-button{
background-image: some gradient !important;
}
.toggled-button {
background-image: another gradient !important;
}
推荐答案
将背景颜色设置为透明并添加.active类似乎奏效了!
.untoggled-button{
background-image: some gradient !important;
background-color: transparent !important;
}
. untoggled-button.active {
background-image: another gradient !important;
}
这篇关于更改Reaction-Bootstrap中的切换按钮颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
织梦狗教程
本文标题为:更改Reaction-Bootstrap中的切换按钮颜色


基础教程推荐
猜你喜欢
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- npm start 错误与 create-react-app 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01