I’m trying to access the background colour of the Angular theme. It woks as a HEX value but I need to apply transparency to the colour.
I have this variable definition:
:root {
--opacity: .15;
--primary: #4caf50;
--accent: #6a1b9a;
--warn: #f44336;
}
exporting the function
@function getColor($color, $opacity: 1) {
@return rgba(var(--#{$color}), $opacity);
}
with this function which is supposed to give the color with alpha value:
and somewhere in another component file there is:
@use "whatever" as UI;
...
[_nghost-ng-c2555015885] mat-sidenav[_ngcontent-ng-c2555015885] {
outline: UI.getColor(primary, .25) 1px solid;
}
I would expect the colour to be evaluated but instead I just get plain text.