Here is an interesting concept: adding a CSS-selector optionally to the existing selector stack within a mixin.
This is what I envision:
@mixin myMixin(mobileSelector:true) {
@if(mobileSelector) {
.foo .mobile:before,
}
.classXY .subclass:before{
color: red;
}
}
.awesomeClass-A {
@include myMixin();
}
@media (min-width: 1025px){
.awesomeClass-B {
@include myMixin(false);
}
}
Desired compilation result:
.awesomeClass-A .foo .mobile:before,
.awesomeClass-A .classXY .subclass:before {
color: red;
}
@media (min-width: 1025px) {
.awesomeClass-B .classXY .subclass:before {
color: red;
}
}
Any ideas on making this happen? :)