$roboto-font-path: '../../fonts' !default;
$roboto-font-display: auto !default;

@mixin roboto-font($type, $weight, $style) {
    @font-face {
        font-family: 'Roboto';
        src: asset-url("#{$roboto-font-path}/Roboto-#{$type}.eot");
        src: local('Roboto #{$type}'),
             local('Roboto-#{$type}'),
             asset-url("#{$roboto-font-path}/Roboto-#{$type}.eot?#iefix") format('embedded-opentype'),
             asset-url("#{$roboto-font-path}/Roboto-#{$type}.woff2") format('woff2'),
             asset-url("#{$roboto-font-path}/Roboto-#{$type}.woff") format('woff'),
             asset-url("#{$roboto-font-path}/Roboto-#{$type}.ttf") format('truetype'),
             asset-url("#{$roboto-font-path}/Roboto-#{$type}.svg#Roboto") format('svg');
        font-weight: $weight;
        font-style: $style;
        font-display: $roboto-font-display;
    }

    @font-face {
        font-family: 'Roboto-#{$type}';
        src: asset-url("#{$roboto-font-path}/Roboto-#{$type}.eot");
        src: local('Roboto #{$type}'),
             local('Roboto-#{$type}'),
             asset-url("#{$roboto-font-path}/Roboto-#{$type}.eot?#iefix") format('embedded-opentype'),
             asset-url("#{$roboto-font-path}/Roboto-#{$type}.woff2") format('woff2'),
             asset-url("#{$roboto-font-path}/Roboto-#{$type}.woff") format('woff'),
             asset-url("#{$roboto-font-path}/Roboto-#{$type}.ttf") format('truetype'),
             asset-url("#{$roboto-font-path}/Roboto-#{$type}.svg#Roboto") format('svg');
        font-display: $roboto-font-display;
    }
}

@mixin roboto-font-pair($type, $weight) {
    @include roboto-font($type, $weight, normal);
    @include roboto-font(#{$type}Italic, $weight, italic);
}
