I have a directive that can get the component is used on, via:
constructor(private el: ElementRef) {
const element = this.el.nativeElement;
/* Extra code */
}
Now I need to get the inhheirted final font-size, but trying to do:
fs = window.getComputedStyle(element).getPropertyValue('font-size');
or
fs = element.style.fontSize;
is not returning any value, just an empty string.
also, this question was for no help, as wrapping and injecting the window object lead to the same result
Is there a way to get the font size of the current component?