I am learning SASS and trying out some examples. I have some problem understanding Selector Sequence and why SASS merges them.
In a real world scenario the output can have unwanted css. For eg:-
a{
color: #0086B3;
&:hover{
text-decoration: none;
}
}
#footer a{
color: #a61717;
}
.head-links{
@extend a;
font-weight: bold;
}
This block of code complies to :-
a, .head-links {
color: #0086B3;
}
a:hover, .head-links:hover {
text-decoration: none;
}
#footer a, #footer .head-links {
color: #a61717;
}
.head-links {
font-weight: bold;
}
The problem is that
#footer .head-links
might never be used. So what is the point of merging selector sequence if it is not required.
How can I avoid this.How can I make it extend only :-
a{
color: #0086B3;
&:hover{
text-decoration: none;
}
}
Would that require me using a class instead...