我试图用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类上?
发布于 2014-07-22 18:41:36
这个有用吗?
.test-animation-class
&.ng-hide-remove
&.ng-hide-add.ng-hide-add-active
opacity 0发布于 2014-07-22 19:07:14
runTarm的回答似乎是最“触控”的方式,但如果您不想过度考虑它,这也是有效的:
.test-animation-class.ng-hide-remove
.test-animation-class.ng-hide-add.ng-hide-add-active
opacity 0https://stackoverflow.com/questions/24895002
复制相似问题