Reputation: 474
Is it possibile to load/unload mixins based on a media query? Something like this:
@if @media (min-width: 768px) {
@include mixin1;
}
@else {
@include mixin2;
}
if the condition is met, mixin2
should not be loaded at all.
Upvotes: 0
Views: 102
Reputation: 136
Not really, the sass compiles server side, not knowing the clients screen size. The compiled css will be used for all screen widths, thus:
@include mixin2;
@media (min-width: 768px) {
@include mixin1;
}
Upvotes: 2