我目前正在开发一个 React Web 应用程序。我使用 JSS 创建样式。
为了完成纯CSS多行文本修剪,我需要使用webkit。
这是我尝试使用 webkit 的类(class):
textSearchProductTitle: {
fontWeight: "bolder",
fontSize: 40,
display: "-webkit-box",
maxWidth: "100%",
height: 40*1.3*3,
margin: "0 auto",
lineHeight: 1.3,
//Those two properties don't work
'&::-webkit-line-clamp': 1.3,
'&::-webkit-box-orient': "vertical",
overflow: "hidden",
textOverflow: "ellipsis",
},
由于 webkit 属性不起作用,我想我的语法不正确。所以我的问题是:在 JSS 中使用 webkit 的正确语法是什么?
提前致谢。
最佳答案
如果与 default preset 一起使用,JSS 会在需要时添加前缀。 。这应该可以做到。
textSearchProductTitle: {
fontWeight: "bolder",
fontSize: 40,
display: "box",
maxWidth: "100%",
height: 40*1.3*3,
margin: "0 auto",
lineHeight: 1.3,
lineClamp': 1.3,
boxOrient: "vertical",
overflow: "hidden",
textOverflow: "ellipsis",
},
关于reactjs - 如何将 webkit 与 JSS 结合使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58874110/