0

I'm coding a website for my learning path and I got following issue:
When I Hover &__item, the animation property doesn't appears in style of &__selection...

sass code:

&__item {
  /*...*/

  __selection{
    /*...*/
  }

  &:hover &__selection {
    animation: animSelect 800ms ease-in-out 0ms 1;
  }
}
The.Bear
  • 5,621
  • 2
  • 27
  • 33

1 Answers1

1

You are using the BEM naming convention, to target the __selection class there are a couple of ways you can do it, this stackoverflow answer also covers this issue very well, for now these are my guess

&__item {
  /*...*/

  __selection{
    /*...*/
  }

  &:hover __selection { //more of a normal css solution

    animation: animSelect 800ms ease-in-out 0ms 1;

  }
}

or


.item{ 

    &__selection {
         /*...*/
    }

    &:hover & {
        &__selection  {
             /*...*/
        }   
    }
}

Vincenzo
  • 375
  • 3
  • 15