i have two images stacking on-top of each other and i am adding some shadow in order to give the a 3d effect. The issue i am running into is, i want the first-of-type
to initially have a box-shadow, and when the last-of-type
is hovered, this shadow on the first-of-type
is removed.
When the first-of-type
is hovered however, this shadow grows. How would i go about doing this? I've tried sibling selectors but i found out you cant "go up the sibling tree", so i am looking for a way to do this.
Also tried something like &:not(:hover):first-of-type {}
, to no success
CSS
&__image {
&:hover {
//do stuff
//what i want to do
if(last-child) then first-of-type box-shadow = none
}
}
and then if neither is hovered, the first-of-type
should return to its initial state ( small shadow ). Note: these components are direct siblings, eg
HTML
<div>
<img...>
<img...>
</div>
thanks in advance,