0
@mixin font-face($font-family, $file-path, $weight: normal, $style: normal, $asset-pipeline: false ) {
    @font-face {
        font-family: $font-family;
        font-weight: $weight;
        font-style: $style;

        @if $asset-pipeline == true {
            src: font-url('#{$file-path}.eot');
            src: font-url('#{$file-path}.eot?#iefix') format('embedded-opentype'),
            font-url('#{$file-path}.woff2') format('woff2'),
            font-url('#{$file-path}.woff') format('woff'),
            font-url('#{$file-path}.ttf') format('truetype'),
            font-url('#{$file-path}.svg##{$font-family}') format('svg');
        } @else {
                src: url('#{$file-path}.eot');
                src: url('#{$file-path}.eot?#iefix') format('embedded-opentype'),
                url('#{$file-path}.woff2') format('woff2'),
                url('#{$file-path}.woff') format('woff'),
                url('#{$file-path}.ttf') format('truetype'),
                url('#{$file-path}.svg##{$font-family}') format('svg');
        }
    }
}

Использую такой миксин для шрифтов, но не понимаю зачем нужна строчка $asset-pipeline: false.

1 ответ 1

1

Это для поддержки Rails

To make this work with asset pipeline in Rails 4.2 I changed url to font-url.

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.