I have a simple anchor button:
<a href="/our-news" class="SectionNavButton">
<span class="SectionNavButton-Inner">
</a>
I would like the background colour of SectionNavButton-Inner
to transition when its parent SectionNavButton
is hovered over/off and when a class of active
is added to it (the parent).
My Sass:
.SectionNavButton
{
.SectionNavButton-Inner
{
@include transition(background 0.4s ease-in-out);
background: $style-default-link-color;
}
&:hover,
&.active
{
.SectionNavButton-Inner
{
background: $style-default-link-hover-color;
}
}
}
This works great for hover, but there is no transition when I add an active
class to the SectionNavButton
(though the background colour does change).
Why is there no transition when I add a class of active
to the SectionNavButton
?