user3564040
user3564040

Reputation:

Angular 2 styles not showing as I want in dev-tools

I'm working on an angular 2 project and got stuck on this issue:

  1. I use sass to compile my style to compressed css: enter image description here
  2. Then I get the css-file in my component: enter image description here
  3. The style-code works. BUT when I check dev-tools it looks like this: enter image description here (notice the "<style>...</style>" in the end)

  4. Now, my problem is that I want the styles to be shown like this: enter image description here

Anyone that knows how I can fix this?

Upvotes: 0

Views: 524

Answers (1)

Latin Warrior
Latin Warrior

Reputation: 932

If you are using the Angular CLI, you can add the --extract-css true flag to the CLI command, like so,

$ ng s -o --extract-css true

In this way, you get a link to the CSS line so you can drill into it.

enter image description here

Upvotes: 1

Related Questions