Angular export components's css files into assets

317 Views Asked by At

Recently i saw a new angular project (v10) with a curious stucture. Owners said they decided to put all css component files into an asset folder like the example below:

+ src
   + app
      - app.component.ts
      - app.component.html
      - app.component.scss
      - app.module.ts
      - app.routing.ts
      + components
         + foo
            - foo.component.ts
            - foo.component.html
         + bar
            - bar.component.ts
            - bar.component.html 
   + assets
      + scss
         + components
            - foo.scss
            - bar.scss

I'm really curious about this because i always though that it was a bad idea to separate the css of the component in another file but i dont found any documentation or recommendations about this.

Is it a good practice to move the component's css file to assets ?

0

There are 0 best solutions below