Reputation: 1539
I'm trying to set the color of all 'button' and 'a' tags to a color coming from a variable. Like this, which obviously doesn't work.
@Component({
styles: [`
a, button {
color: {{ color_from_variable }};
}
`]
Upvotes: 1
Views: 805
Reputation: 3460
This worked for me :
export const mainColor = 'blue';
@Component({
...
styles: [`
p {
color: `+mainColor+`;
}
`]
})
Here is a StackBlitz example I made for this : https://stackblitz.com/edit/angular-vpaarz
Upvotes: 1