【发布时间】:2016-05-25 09:17:03
【问题描述】:
当它嵌套在伪选择器中时,我试图在 Stylus 中获取父选择器。因此,虽然我可以在第一次嵌套中执行 &-image,但我似乎无法让它在 &:hover 中工作
.post-news
&-image
display: none
&:hover
&-image // this isn't working
display: block
我理解为什么它不起作用,因为 & 不再引用 .post-news。我尝试了这里列出的选择器http://stylus-lang.com/docs/selectors.html,例如:
../-image
/-image
^[0]-image
但到目前为止我无法让它工作;我不确定我需要哪一个。我错过了什么?
【问题讨论】: