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

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.


As far as I know you can't import fonts using @import in SCSS. You can include fonts using @font-face. For example:

@font-face {
    font-family: 'Open Sans';
    src: url(path/to/file) format(Example: 'truetype' or 'opentype' depending on the file extension of your font);
}


// USAGE
body {
    font-family: 'Open Sans', sans-serif;
}

it's a bit late but you can use the following format with libsass for external imports

@import url("http...");

Tags:

Sass