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

Feature request: enable providers to resolve to custom urls #2237

Closed
4 tasks done
JessicaSachs opened this issue Feb 22, 2023 · 3 comments
Closed
4 tasks done

Feature request: enable providers to resolve to custom urls #2237

JessicaSachs opened this issue Feb 22, 2023 · 3 comments

Comments

@JessicaSachs
Copy link

Clear and concise description of the problem

I can't use a 3rd party font provider in production due to CSP + security issues. I'd like to be able to specify the location of the fonts I'm using.

Suggested solution

We could add a provider function on each font so that you could load custom fonts from certain places (CDN, s3, wherever) and use Google or the primary provider as a fallback.

Alternative

No response

Additional context

No response

Validations

  • Read the Contributing Guidelines.
  • Read the README.md of using the package.
  • Already used the Interactive Docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
@zyyv
Copy link
Member

zyyv commented Feb 23, 2023

We have this field in the preset-web-fonts opiton, can it help you?

const promise = customFetch
? customFetch(url)

@JessicaSachs
Copy link
Author

I don't think so. Isn't customFetch is executed node-side?

I want to change the value of what url("https://whateverUrl") value in the font-face is.

@antfu
Copy link
Member

antfu commented Apr 23, 2023

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

Successfully merging a pull request may close this issue.

3 participants