Closed siMobin closed 8 months ago
If I understand you correctly, you can write:
.a {
background-color: red;
color: white;
padding: 1em;
}
.b, .c, .d {
@extend .a;
}
.b {
margin: 1em;
}
.c {
padding: 5em;
}
.d {
background-color: blue;
}
This is a lot of extra, complex syntax for something that (as @ntkme points out) isn't that difficult to do already.
I believe that sass is made to make css easy to write. So, writing the same thing again and again is annoying, I think. Although sass already supports nesting natively, why doesn't it support the extend method in a similar manner?
I'd like to propose a different way to define inheritance by nesting the classes within the super class that would allow multiple classes to inherit a class at once without having to inherit them separately.
For example: