我正在尝试使用 AngularJS 制作一些动画,但在尝试使用 Stylus 设置 AngularJS 动画 CSS 类时遇到了问题。我需要最终的 CSS 看起来像这样:
.test-animation-class.ng-hide-remove,
.test-animation-class.ng-hide-add.ng-hide-add-active {
opacity 0
}
我尝试了以下手写笔:
.test-animation-class
&.ng-hide-remove
&.ng-hide-add
&.ng-hide-add-active
opacity 0
但结果看起来像这样:
.test-animation-class.ng-hide-remove.ng-hide-add-active,
.test-animation-class.ng-hide-add.ng-hide-add-active {
opacity 0
}
有没有办法指定 .ng-hide-add-active
类只在直接父 CSS 类 .ng-hide-add
上,而不是 .ng-hide-remove
类?
最佳答案
这行得通吗?
.test-animation-class
&.ng-hide-remove
&.ng-hide-add.ng-hide-add-active
opacity 0
关于css - 使用 Stylus 的嵌套 CSS 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24895002/