Can you implement @import and @ font-face in the same project?

4

I downloaded the Fonts from Google Fonts and I want to know if it is possible to use @import and @ font-face in the same project in case one of the 2 ways to load fonts does not work. example:

@import 'https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900';

@font-face {
  font-family: robotoReplacement;
  src: url(Roboto-light.ttf),
       url(Roboto-thin.ttf),
       url(Roboto-Regular.ttf),
       url(Roboto-Medium.ttf),
       url(Roboto-Bold.ttf),
       url(Roboto-black.ttf); 
}

body {
  font-family: 'Roboto', robotoReplacement;
}

p {
  font-weight: normal;
}

h1 {
  font-weight: bold;
}

Is it possible?

    
asked by adrianojosue 22.06.2016 в 06:31
source

1 answer

2

Yes, since they are two different things.

The @import is for importing another style sheet file (.css) and the @font-face is exclusively for adding text fonts.

You will find more information on this link:

link

answered by 28.07.2016 в 22:41