Base solution for your next web application
Open Closed

Metronic-Customize LESS instead of CSS #6722


User avatar
0
SBJ created

Hello,

We recently purchased ASP.NET Zero and started working on our installation.

I looked into adding a custom Metronic theme and I successfully added a new colour (using MetronicThemeChanger) to the pallette of the Default theme, including the custom theme folders with metronic-customize, etc. However, I noticed that assets/common/styles/themes/mytheme/metronic-customize.cssis used and that assets/common/styles/themes/mytheme/metronic-customize.lessis not compiled/built to the .cssvariant. So when I make changes to the .lessfile, the changes are not reflected in the .cssfile.

I saw that DynamicResourcesHelper.tsincludes the PrimeNG CSS and the above mentioned metronic-customize.css, but how can I change this to include/use the .lessvariant without changing core code? Changing it in DynamicResourcesHelper.tswould mean that I can't upgrade without losing this modification. I can't edit AppPreBootstrap, which seems to load in the DynamicResourcesHelper, as that is basically core code as well.

I also tried adding the .lessfile in angular.json(tried it both before styles.cssand after it), but the changes in the .lessfile are still overridden by the .cssone. And I also tried using @importfor that file in src/styles.css, which doesn't seem to work either.

Any tips on how to approach this would be appreciated. :)


2 Answer(s)
  • User Avatar
    1
    ismcagdas created
    Support Team

    Hi @sbj

    We will work on this issue in https://github.com/aspnetzero/aspnet-zero-core/issues/2276.

    As a temporary solution, if you are working on Windows, you can use WebCompiler extension to bundle for less files.

  • User Avatar
    0
    SBJ created

    Hello @ismcagdas,

    I'll use the workaround in the meantime, whilst waiting for the new release.

    Thanks for the help and quick reply! :)