伪元素在 Material-UI makeStyles React.js 中不起作用
Pseudo elements are not working in Material-UI makeStyles React.js
伪元素在 Material-UI makeStyles 中不起作用。
innerBox: {
borderRadius: "10px",
background: "#fff",
boxShadow: "0px 1px 3px 0px rgba(0, 0, 0, 0.36)",
maxHeight: "50px",
"& ::before": {
content: "anything"
}
}
这里的问题似乎是你的选择器,它不正确而不是 & ::before
尝试 &:before
innerBox: {
borderRadius: "10px",
background: "#fff",
boxShadow: "0px 1px 3px 0px rgba(0, 0, 0, 0.36)",
maxHeight: "50px",
"&:before": {
content: "anything"
}
}
伪元素在 Material-UI makeStyles 中不起作用。
innerBox: {
borderRadius: "10px",
background: "#fff",
boxShadow: "0px 1px 3px 0px rgba(0, 0, 0, 0.36)",
maxHeight: "50px",
"& ::before": {
content: "anything"
}
}
这里的问题似乎是你的选择器,它不正确而不是 & ::before
尝试 &:before
innerBox: {
borderRadius: "10px",
background: "#fff",
boxShadow: "0px 1px 3px 0px rgba(0, 0, 0, 0.36)",
maxHeight: "50px",
"&:before": {
content: "anything"
}
}