Inject configuration variables to css at runtime

Hey everyone,
we have a custom icon font in our app, and in our css somewhere there’s the point where we specify the @font-face for this font, so far similar to @font-face { src: url("/frontend/assets/fonts..") } and the font files are placed into resources/META-INF/resources and picked up from there.
This is fine until we try to deploy the app under some subpath, e.g. http://example.com/myapp. In this case, myapp can be configured by the party running our app (especially after build time), so I now I need to communicate this config value somehow to the part that creates the @font-face rule.
Fiddling with the vite build does not seem to work, as vaadinBuildFrontend is as far as I know not done when shipping a product, and using css custom properties is infeasible for this case.
Does anyone have an idea how to do this?

Try using a relative path instead of an absolute, that should work no matter the context

Mhh… when I am on http://example.com/myapp/my/path/to/my/controller a relative path tries to get the fonts from http://example.com/myapp/my/path/to/my/controller/frontend/assets/fonts/myfont.woff

Tested in dev mode, vaadin 23 with vite

I’m not sure, because I did not tested it, but you can try to see if Frontend/ prefix works. IIRC it should be resolved by Vite to the frontend folder.
url('Frontend/assets/fonts...')