@mixin font-weights($device: "") {
    @each $name, $weight in $weights {
        %#{$device}#{$name} {
            font-weight: #{$weight};
        }

        @if $classes {
            .#{$device}#{$name} {
                @extend %#{$device}#{$name};
            }
        }
    }
}

@include font-weights;

@each $device, $pixels in $devices {
    @include media($device) {
        @include font-weights($device + "-");
    }
}

@include mobile {
    @include font-weights("mobile-");
}
