gabiseabra / google-fonts-webpack-plugin

129 stars 44 forks source link

Wrong font.css file #11

Closed ruscon closed 7 years ago

ruscon commented 7 years ago
/**
 * Download Google fonts to webpack build folder using google-webfonts-helper
 * Reference: https://github.com/gabiseabra/google-fonts-webpack-plugin
 */
new GoogleFontsPlugin({
  fonts: [
    {
      family  : 'Lobster',
      subsets : ['cyrillic']
    },
    {
      family  : 'Comfortaa',
      variants: ['300,400,700'],
      subsets : ['cyrillic']
    },
    {
      family  : 'Oswald',
      variants: ['200,300,400,500,600'],
      subsets : ['cyrillic']
    }
  ],
  path : 'fonts/'
  /* ...options */
})

all font files downloaded

font.css file only one font


/* === Lobster - regular */
@font-face {
    font-family: 'Lobster';
    font-style: normal;
    font-weight: 400;
    src: url("./fonts/Lobster-Regular.eot");
    src: local("Lobster"),
        local("Lobster-Regular"),
        url("./fonts/Lobster-Regular.eot") format("embedded-opentype"),
        url("./fonts/Lobster-Regular.woff2") format("woff2"),
        url("./fonts/Lobster-Regular.woff") format("woff"),
        url("./fonts/Lobster-Regular.ttf") format("truetype"),
        url("./fonts/Lobster-Regular.svg") format("svg");
}
ruscon commented 7 years ago

Sorry, resolved

Wrong format

variants: ['200,300,400,500,600'],

Should be

variants: ['300', '400', '500', '700'],