Is it possible to remove/change styles on sibling class on hover using pure CSS?
I've tried something like this and failed miserably.
HTML:
<ul>
<li class="item active">name1</li>
<li class="item">name2</li>
<li class="item">name3</li>
<li class="item">name4</li>
</ul>
SCSS
ul {
padding: 0;
margin: 0;
li {
cursor: pointer;
list-style: none;
padding: 12px 16px;
&.active {
background-color: $primary-blue;
color: white;
}
&:hover {
background-color: $primary-blue;
color: white;
~ .active {
background-color: white !important;
color: black !important;
}
}
}
}
So what do i want to achieve... I want to HOVER on any element to give it specific style and at the same time i want to hide style of active element. The active element is random, it can be third, second, first, fourth etc... List goes up to 10 elements. This example is simplified.
EDIT! IMPORTANT! I see people have problems understanding what the hell do i want, i hope this plunker will clarify everything :)