Where to post generic CSS in Angular 2

I looked at the project structure in the Angular 2 style guide ( angular.io ). Everything they recommend seems to make sense, but one thing bothers me: where would you put regular CSS in this structure?

By plain CSS, I mean things like the Sass partials that you want to import into several other CSS files. Or even for HTML if you use a template language.

+8
source share
4 answers

When using SCSS, this is a good way to create a file shared/shared.scssthat contains common styles. And import other components that you add @import '../shared/shared';on top of your scss file to use these common styles.

+7
source

If you create your project using angular cli, you will find the file styles.cssin the folder src. Put all your common styles in this file.

.angular-cli.json the file mentions this file to be linked as a style

"styles": [
        "styles.css"
      ],
+13
source

" Angular " Angular 2 . shared ( app), . CSS shared.

+1

, CSS . CSS styles.scss, angular.json styles.

The common module is used only for components, pipelines, directives, and shared TS files.

0
source

Source: https://habr.com/ru/post/1658278/


All Articles