Hello,
I’m on ABP 9.2.3 (Blazor Server) with LeptonX. I couldn’t find a style-initializer.js in this setup; instead the CSS (including font-bundle.css) appears to be managed by leptonx-blazor-compatibility.js.
To keep fonts fully local, I took the following approach:
Override the compatibility script just for the font bundle I copied the file into my project as leptonx-blazor-compatibility-override.js and changed the URL resolution only when the font bundle is requested:
// inside createStyleUrl(...)
if (theme === 'font-bundle') {
return baseUrl + "styles/leptonx/font-bundle.css"; // local file
}
Bundle contributor to prefer my override script
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.RemoveAll(x => x.FileName.EndsWith("leptonx-blazor-compatibility.js"));
context.Files.AddIfNotContains("/scripts/leptonx-blazor-compatibility-override.js");
}
And in Configure<AbpBundlingOptions>:
options.ScriptBundles.ConfigureAll(o =>
{
o.AddContributors(typeof(LeptonXThemeScriptOverrideContributor));
});
I replaced <leptonx-theme-appearance />
in _Host.cshtml with explicit links (side-menu) and included my local font bundle:
This works, but it feels like a lot of plumbing just to make the font sheet local-only.
Questions / suggestions:
Thanks in advance for any guidance or a roadmap note—happy to adjust to the recommended approach if there’s a cleaner, supported way.
Hello,
We are using Blazor Server with Tiered Architecture, and I've also tried to make a Contributor which replace file but unfortunatelly from .Files i didn't see any similar to font-bundle.css
Yes i was checking this issue https://abp.io/support/questions/6503, but video which abp support provides is no longer available.
Hello ABP Support Team,
We’re experiencing an issue with Lepton Theme X in one of our customer environments that has restricted network access. The environment has full internal connectivity but no access to the public internet (e.g., requests to google.com or other external CDNs are blocked).
When some pages are force-loaded, the browser tries to fetch fonts from external sources defined in font-bundle.css. Because those CDN requests cannot reach the outside network, the browser hangs while trying to load them and then fails after about 20 seconds, significantly delaying the page load and affecting the user experience.
This is content of font-bundle.css
@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");
Details:
Issue:
Behavior:
Workaround: We’ve temporarily mitigated the problem by intercepting the CSS file request and returning an empty CSS response, like this:
app.Map("/_content/Volo.Abp.AspNetCore.Components.Web.LeptonXTheme/side-menu/css/font-bundle.css", b =>
{
b.Run(async ctx =>
{
ctx.Response.ContentType = "text/css; charset=utf-8";
await ctx.Response.WriteAsync("/* CLEARED font-bundle.css (no remote fonts) */");
});
});
Request: