I have create a new project using @angular/cli (12.2.13):
ng new test
I also said I wanted the configuration to be with scss.
In my styles.scss, I did add:
:root {
--myVar: red;
}
I then run ng build --configuration production
and when I checked the resulting index.html in my dist/ folder I have:
<style>:root{--myVar:red}</style><link rel="stylesheet" href="styles.b08f420056d5c4d3e83d.css" media="print" onload="this.media='all'"></style>
with styles.b08f420056d5c4d3e83d.css also containing :root{--myVar:red}
In production, it does result in having that css variable twice. Is there any way to prevent this ?