Is it possible to import fonts from the directory with scss?

前端 未结 3 2125
忘了有多久
忘了有多久 2021-02-18 13:10

I have a scss file with font import implemented this way:

@import url(https://fonts.googleapis.com/css?family=PT+Sans+Caption:400,700&subset=latin-ext,cyrill         


        
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-18 14:07

    Usually it's used to import CSS fragments or files and not fonts. Try this workaround if you are using Ruby SASS/SCSS and try without brackets.

    @import "https://fonts.googleapis.com/css?family=PT+Sans+Caption:400,700&subset=latin-ext,cyrillic.css"; 
    

    I put a .css behind it. Works for me with Ruby SASS/SCSS but not with LibSass though.

提交回复
热议问题