Using the ~
selector to target list items after the class .is-middle
is found, but struggling to select each subsequent list item with nth-child(1), nth-child(2)...
. Any insights on what might be causing this issue?
SCSS
.ctn {
li {
width: 100%;
height: 50px;
background: lightgrey;
border-bottom: 1px solid #eee;
&.is-middle ~ li {
&:nth-child(1) {
background: purple;
}
&:nth-child(2) {
background: green;
}
&:nth-child(3) {
background: yellow;
}
}
}
}