我正在尝试将 CSS 代码从 Stylus 转换为 Emotion。在 Stylus 中与 CSS 一样,您可以添加伪元素::selection
来更改color
文本被选中的时间。
// Stylus
#adventure
max-width: 1400px
::selection
color: $adventure-background
我尝试了这种语法,但似乎无法正常工作
// Emotion
export const Adventure = styled.div`
max-width: 1400px;
/* @TODO not working */
&::selection {
color: ${colors.greenWater};
}
`;
如果有人有线索!谢谢你的帮助!