Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paths in css are broken if prefix contains url #15

Open
linux019 opened this issue Jan 4, 2018 · 0 comments
Open

Paths in css are broken if prefix contains url #15

linux019 opened this issue Jan 4, 2018 · 0 comments

Comments

@linux019
Copy link

linux019 commented Jan 4, 2018

const fontDownloader = require('goog-webfont-dl');

fontDownloader({
    font: 'Roboto',
    formats:     ["woff", "woff2"],//fontDownloader.formats, // Font formats.
    destination: path.join(__dirname, 'public/fonts/roboto'),               // Save font here
    out:         path.join(__dirname, 'resources/assets/fonts/roboto.css'), // CSS file. Use '-' for stdout, and nothing to return the CSS code
    prefix:      `http://test.localhost/fonts/roboto`, // Prefix to use in CSS output
    subset:      null, // = none     // Subset string/array, e.g. 'latin,cyrillic'
    styles:      '400,400i,700,700i',  // Style string/array, e.g. '300,400,300italic,400italic'
})

Output:

@font-face {
  font-family: 'Roboto';
  font-style: italic;
  font-weight: 400;
  src: local('Roboto Italic'), local('Roboto-Italic'), url(http:/test.localhost/fonts/roboto/Roboto-Italic.woff2) format('woff2'), url(http:/test.localhost/fonts/roboto/Roboto-Italic.woff) format('woff');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant