我正在尝试使用 React 的样式化组件来设计 slider 样式,但我不知道如何设计拇指样式。我有一个看起来像这样的 CSS:
.faderInput::-webkit-slider-thumb {
-webkit-appearance: none;
width: 15px;
height: 15px;
border:1px solid black;
...
}
我的样式组件看起来像这样
const FaderInput = styled.input`
...
::-webkit-slider-thumb {
-webkit-appearance: none;
width: 15px;
height: 15px;
border:1px solid black;
...
}
`;
有人知道如何将此类选择器移植到样式组件吗?
最佳答案
我真的得到了帮助。你必须添加一个 & 然后它看起来像这样:
const FaderInput = styled.input`
...
&::-webkit-slider-thumb {
-webkit-appearance: none;
width: 15px;
height: 15px;
border:1px solid black;
...
}
关于css - 使用样式化组件样式化 slider 拇指,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47921532/