2

Привет!Я начал изучать Angular и решил сделать приложение на нем и мне понадобилось подключить шрифты

@import "fontello.scss"


@font-face
    font-family: 'latoblack'
    src: url('../assets/fonts/LatoBlack/lato-black.eot')
    src: url('../assets/fonts/LatoBlack/lato-black.eot?#iefix') format('embedded-opentype'),
         url('../assets/fonts/LatoBlack/lato-black.woff') format('woff'),
         url('../assets/fonts/LatoBlack/lato-black.ttf') format('truetype')
    font-weight: normal
    font-style: normal

@font-face
    font-family: 'latobold'
    src: url('../assets/fonts/LatoBold/lato-bold.eot')
    src: url('../assets/fonts/LatoBold/lato-bold.eot?#iefix') format('embedded-opentype'),
         url('../assets/fonts/LatoBold/lato-bold.woff') format('woff'),
         url('../assets/fonts/LatoBold/lato-bold.ttf') format('truetype')
    font-weight: normal
    font-style: normal

@font-face
    font-family: 'latoitalic'
    src: url('../assets/fonts/LatoItalic/lato-italic.eot')
    src: url('../assets/fonts/LatoItalic/lato-italic.eot?#iefix') format('embedded-opentype'),
         url('../assets/fonts/LatoItalic/lato-italic.woff') format('woff'),
         url('../assets/fonts/LatoItalic/lato-italic.ttf') format('truetype')
    font-weight: normal
    font-style: normal

@font-face
    font-family: 'latolight'
    src: url('../assets/fonts/LatoLight/lato-light.eot')
    src: url('../assets/fonts/LatoLight/lato-light.eot?#iefix') format('embedded-opentype'),
         url('../assets/fonts/LatoLight/lato-light.woff') format('woff'),
         url('../assets/fonts/LatoLight/lato-light.ttf') format('truetype')
    font-weight: normal
    font-style: normal

@font-face
    font-family: 'latoregular'
    src: url('../assets/fonts/LatoRegular/lato-regular.eot')
    src: url('../assets/fonts/LatoRegular/lato-regular.eot?#iefix') format('embedded-opentype'),
         url('../assets/fonts/LatoRegular/lato-regular.woff') format('woff'),
         url('../assets/fonts/LatoRegular/lato-regular.ttf') format('truetype')
    font-weight: normal
    font-style: normal

Использовал синтаксис Sass встроенный в AngularClI --style=sass.Но я получил ошибку.

ERROR in ./src/app/app.component.sass
Module build failed:
         url('../assets/fonts/LatoBlack/lato-black.woff') format('woff'),
        ^
      Property "url" must be followed by a ':'
      in X:\projects\BranD\src\app\app.component.sass (line 8, column 10)

Можете подсказать в чем я ошибся и как это исправить?

1 ответ 1

3

везде перед url поставить src:

Ваш ответ

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

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