I have the following code:
article.featured {
h4 {
margin-bottom: 20px
}
:first-child {
height: 100%;
padding-top: 0;
padding-left: 0;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
.img {
@extend &;
}
}
:last-child {
padding-top: 0;
padding-right: 0
}
}
This is line 13
:
@extend &;
The problem is that when I try to compile this stylesheet, I get the following error:
Parent selectors aren't allowed here.
╷
10│ @extend &;
│ ^
╵
stdin 13:19 root stylesheet on line 10 at column 19
How can I solve this error and extend the .img
element with the parent (&
) element's properties?