Base solution for your next web application
Open Closed

Is there a way to bundle all the css ? #8849


User avatar
0
MellowoodMedical created

Hi, Our project is using Angular as the UI side framework. We are trying to optimize the solution when the very first load of the screen and wish to bundle all the css into a single one. We notice that there is a DynamicResourcesHelper.ts to load some of the css, including primeng.datatable etc. Is there a way to bundle those as one? Thanks.

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @MellowoodMedical

    Those files are loaded dynamically according to selected UI theme. There are 12 different UI themes. If you want to use only one theme, you can delete other styles and add those style files into your angular.json file.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    MellowoodMedical created

    Thanks. There is one more question, we want to change the theme base on the user roles. So there are two roles in the system and each of them will have their own theme. Any suggestions on how to implement that?

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    1
    ismcagdas created
    Support Team

    Hi,

    You can change the selected theme here https://github.com/aspnetzero/aspnet-zero-core/blob/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Core/UiCustomization/UiThemeCustomizerFactory.cs#L26 according the role of current user.

    There might be other places this setting is used. You can search for it in the solution.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)