我可以在 Styled Component 中设置 css of Child 吗?

Can I set css of Child in Styled Componet?

在正常 CSS 中,我可以使用 parent 的引用将 css 应用到 child。

.ABC > div {
    color: red;
}  

我想知道,我可以在样式组件中做同样的事情吗?

是的,这是可能的。 & 指的是当前元素,所以你可以像下面这样应用选择器:

& > div {
    color: red;
}

有关演示,请参阅 this codesandbox

您可以通过 chrome 调试器查看它如何应用样式: