Currently, I am attempting to add style to a pseudo element :after
<a class="overflow">{{item?.eco}}</a>
My goal is to modify the background color of a:after
, and I believe this adjustment needs to be made in HTML.
I've been thinking about something like applying [style.background]="red" directly to
a:after
in the HTML itself instead of using CSS.
CSS
.featured-image:after { content: '';
background-color: var(--custom); }
HTML
<a class="featured-image"[style]="sanitizer.bypassSecurityTrustStyle('--custom:' + red)"></a>
TS
this.color = sanitizer.bypassSecurityTrustStyle('--custom')
Despite my attempts at implementing this approach, I have not seen any success so far.
If you have any insights or suggestions on how to achieve this, I would greatly appreciate your help...