【发布时间】:2020-02-13 02:15:25
【问题描述】:
我正在使用 antd NPM 包的 Select 组件。我想删除组件聚焦时出现的蓝色轮廓。如何删除它?
我尝试过使用样式化组件来设置组件的样式。样式如下所示:
const StyledSelect = styled(Select)`
& .ant-select-selection__rendered {
width: 200px;
margin-left: 0;
margin-right: 0;
&:focus {
outline: none;
border: none;
}
}
&.ant-select-focused {
border: none;
&:focus{
outline: 0;
}
}
`;
我希望删除蓝色轮廓。但我的造型似乎不起作用
【问题讨论】:
-
您为什么要这样做? Ant 设计已经做出了很好的焦点风格,它对可访问性很重要。发帖前有看标记吗?看起来他们将其应用于
.ant-select-selection和.ant-select-selection:focus并使用边框 + 框阴影... -
@Dominic 我也尝试过覆盖
.ant-select-selection和.ant-select-selection:focus。它没有帮助。大纲还在
标签: reactjs styled-components antd