Open Closed

Stylesheets are loaded very late #4809


User avatar
2
ageiter created
  • ABP Framework version: v7.1.0

  • UI type: Blazor Server

  • DB provider: EF Core

I have the problem that when I refresh (F5) the page of my Blazor Server App, the stylesheets are loaded much too late, resulting in ugly effects (see screencast here).

I recently upgraded to version 7.1.0 and feel that this problem was not so extreme before.

You can see in the following image that the CSS files are loaded after about 1 second.

image.png

I have now tried to combine all these files into one bundle.

// Blazor UI
options.StyleBundles.Configure(
    BlazorLeptonXThemeBundles.Styles.Global,
    bundle =>
    {
        bundle.AddFiles("/global-styles.css");
        bundle.AddFiles("/blazor-global-styles.css");
        bundle.AddFiles("/_content/Volo.Abp.AspNetCore.Components.Web.LeptonXTheme/top-menu/css/bootstrap-gyh.css");
        bundle.AddFiles("/_content/Volo.Abp.AspNetCore.Components.Web.LeptonXTheme/top-menu/css/gyh.css");
        bundle.AddFiles("/_content/Volo.Abp.AspNetCore.Components.Web.LeptonXTheme/top-menu/css/layout-bundle.css");
        bundle.AddFiles("/_content/Volo.Abp.AspNetCore.Components.Web.LeptonXTheme/top-menu/css/abp-bundle.css");
        bundle.AddFiles("/_content/Volo.Abp.AspNetCore.Components.Web.LeptonXTheme/top-menu/css/blazor-bundle.css");
        //You can remove the following line if you don't use Blazor CSS isolation for components
        bundle.AddFiles("/GetYourHouse.Blazor.styles.css");
    }
);

This seems to solve the problem, but now the files are loaded twice. First in the global bundle and then again separately as CSS files.

How should I do this correctly?

Thanks,
Adrian


11 Answer(s)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.2.0-preview. Updated on March 13, 2025, 04:08