You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some web application that works offline or inside (local network), we cannot use this as we need the files to those fonts in the assets of our applications to work properly.
Suggested solution
My suggested solution is inspired from a vite plugin vite-plugin-webfont-dl
An option (global or per font) inside presetWebFonts config, to allow downloading fonts locally, thus the generated styles use the relative path to font file from our project.
This vite plugin https://github.com/feat-agency/vite-plugin-webfont-dl unfortunately does not work with font-faces generated by unocss/presetWebFonts (whether inline import is true or false)
Or did I miss a working configuration or workaround?
Clear and concise description of the problem
When you add fonts using presetWebFonts, for example:
this will create
@font-face
definition for each font, containing the URL from google for example:For some web application that works offline or inside (local network), we cannot use this as we need the files to those fonts in the assets of our applications to work properly.
Suggested solution
My suggested solution is inspired from a vite plugin vite-plugin-webfont-dl
An option (global or per font) inside presetWebFonts config, to allow downloading fonts locally, thus the generated styles use the relative path to font file from our project.
Example for suggested config:
Generated code will be for example:
Alternative
No response
Additional context
This vite plugin https://github.com/feat-agency/vite-plugin-webfont-dl unfortunately does not work with font-faces generated by unocss/presetWebFonts (whether inline import is true or false)
Or did I miss a working configuration or workaround?
Validations
README.md
of using the package.The text was updated successfully, but these errors were encountered: