Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nested CSS Classes with Stylus

I am trying to do some animations with AngularJS and ran into an issue when trying to use Stylus to set the AngularJS animation CSS classes. I need the final CSS to look like this:

.test-animation-class.ng-hide-remove,
.test-animation-class.ng-hide-add.ng-hide-add-active {
    opacity 0
}

I tried the following Stylus:

.test-animation-class
  &.ng-hide-remove
  &.ng-hide-add
    &.ng-hide-add-active
      opacity 0

But that comes out looking like this:

.test-animation-class.ng-hide-remove.ng-hide-add-active,
.test-animation-class.ng-hide-add.ng-hide-add-active {
    opacity 0
}

Is there a way to specify the .ng-hide-add-active class to be only on the immediate parent CSS class, .ng-hide-add, and not the .ng-hide-remove class?

like image 665
anthonylawson Avatar asked May 21 '26 06:05

anthonylawson


1 Answers

Is this works?

.test-animation-class
  &.ng-hide-remove
  &.ng-hide-add.ng-hide-add-active
    opacity 0
like image 68
runTarm Avatar answered May 24 '26 23:05

runTarm



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!