如何更改 react-select 标签边框半径
How to change react-select tag border radius
我正在尝试覆盖 react-select
样式以实现圆形多值标签。
所以我继续编辑 multiValue
样式属性,如下所示:
const customStyles = {
multiValue: (styles) => ({
...styles,
backgroundColor: blue,
borderRadius: "50%",
}),
}
背景颜色完美,标签变为蓝色。但是边框半径总是卡在2px...
<Select
options={options}
styles={customStyles}
isMulti
/>
如何覆盖 react-select
强加的默认 2px 边框半径
原来我覆盖了 multiValueLabel
的背景颜色,它以某种方式隐藏了 multiValue
中被覆盖的边框半径。从 multiValueLabel
中删除 backgroundColor
属性解决了这个问题。
我正在尝试覆盖 react-select
样式以实现圆形多值标签。
所以我继续编辑 multiValue
样式属性,如下所示:
const customStyles = {
multiValue: (styles) => ({
...styles,
backgroundColor: blue,
borderRadius: "50%",
}),
}
背景颜色完美,标签变为蓝色。但是边框半径总是卡在2px...
<Select
options={options}
styles={customStyles}
isMulti
/>
如何覆盖 react-select
原来我覆盖了 multiValueLabel
的背景颜色,它以某种方式隐藏了 multiValue
中被覆盖的边框半径。从 multiValueLabel
中删除 backgroundColor
属性解决了这个问题。