1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Mixing less and sass files in Angular application

Discussão em 'Angular' iniciado por Gianmarco Santi, Setembro 29, 2024.

  1. I'm building an Angular application using the ng-zorro library for components. Usually, I also import the entire Bootstrap css file for some utilities like grid system and spacing classes which I have found very useful. In all my previous experiences I have had problems with conflicts generated by ng-zorro css and Bootstrap css so, for this project, I would like to import only the Bootstrap css classes I need.

    By reading the official documentation I learned how to import specific packages from Bootstrap with SCSS (e.g. @import "../node_modules/bootstrap/scss/utilities"; ).

    Therefore, I have a .less file with the ng-zorro custom theme for the components and a .scss file with the Bootstrap-specific utility classes. The problem is that the Bootstrap scss file appears to not actually be seen by the components.

    It might be helpful to know that I set up the project with Angular CLI and when asked what css file I wanted for the project, I chose less. The reason for my choice was that the ng-zorro custom themes must be written with .less and I want to know if there is a way to tell the Angular compiler to use both .less and .scss.

    Continue reading...

Compartilhe esta Página