Trying to call mixin from list of names - Sass

Viewed 45

i have an list of mixins i want call them inside 1 mixin using loop but when i am trying to include a mixing name using its index inside the list throws an error. is there eny way to fix that!?

@mixin example1 {
    width: 50px;
}
@mixin example2 {
    height: 10px;
}
$arr : (
    'lg':(
        ('example1','.container header'),
        ('example2','.container nav'),
    ),
    'sm': (
        ('example2','.container header'),
    )
);
@mixin mediaRender($z : 'min' ) {
    @each $ind , $val  in $arr {
        @media (min-width:getMedia($ind)){
            @for $i from 1 through length($val){
               $tm : nth($val,$i);
              #{nth($tm,2)}{
                @include nth($tm,1); // Error
               }
            }
        }
    }
}
0 Answers
Related