As you said, everything works fine when your project is builded/launched in your browser. So it's an issue with your IDE.
You have multiple solutions
You can add this <!--suppress ALL-->
at the top of the page until Intellij solves this problem.
<!--suppress ALL-->
<button [ngStyle]="{'color': color}"></button>
<div [ngClass]="'first second'"></div>