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

Option to specify @font-face's src url() when non-root directory? #17

Open
PapiPeppers opened this issue Aug 5, 2023 · 0 comments
Open

Comments

@PapiPeppers
Copy link

If running from root of {someDirectory} where the font files are located in {someDirectory}/{otherDir}/{fontDir}, is there a way to output in the @font-face rules a src url() pointing to ./{otherDir}/{fontDir} instead of the root directory?

Currently, output looks like:

@font-face {
  font-family: 'PPFraktionMono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('PPFraktionMono-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'PPFraktionMono Fallback';
  font-style: normal;
  font-weight: 400;
  src: local('Arial');
  ascent-override: 76.51%;
  descent-override: 14.75%;
  line-gap-override: 21.75%;
  size-adjust: 131.49%;
}

html {
  font-family: 'PPFraktionMono', 'PPFraktionMono Fallback';
}

But need output to be this:

@font-face {
  font-family: 'PPFraktionMono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('**/{otherDir}/{fontDir}/**PPFraktionMono-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'PPFraktionMono Fallback';
  font-style: normal;
  font-weight: 400;
  src: local('Arial');
  ascent-override: 76.51%;
  descent-override: 14.75%;
  line-gap-override: 21.75%;
  size-adjust: 131.49%;
}

html {
  font-family: 'PPFraktionMono', 'PPFraktionMono Fallback';
}
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