【发布时间】:2021-08-03 21:43:43
【问题描述】:
我想更改 ipywidget ToggleButton 的按钮颜色。 在文档中它被描述为:
widgets.ToggleButtons(
options=['Slow', 'Regular', 'Fast'],
description='Speed:',
disabled=False,
button_style='', # 'success', 'info', 'warning', 'danger' or ''
tooltips=['Description of slow', 'Description of regular', 'Description of fast'],
# icons=['check'] * 3
)
我能看到的唯一方法是使用 button_style,但它只有在代码中看到的预定义选项。 有没有办法用自定义按钮颜色自己定义这样的预设? 我还尝试使用 CSS 对其进行样式设置。 button_color、description_color 和 background_color 都不起作用。
我无法将切换按钮颜色更改为预定义配色方案(“成功”、“信息”、“警告”、“危险”或“”)以外的任何颜色。也跳进包里,我没有找到它们是在哪里定义的。这就是为什么我无法覆盖它们。
另外,我正在使用 Jupyter Notebook。
亲切的问候, 蒂莫
【问题讨论】:
标签: python jupyter-notebook ipywidgets