I have mat-card with dynamic background image and i need blur this image
<mat-card [ngStyle]='{backgroundImage: backgroundImage}'>
<mat-card-title>My card</mat-card-title>
<mat-card-content>Card Content</mat-card-content>
</mat-card>
my css
mat-card {
background-repeat: no-repeat;
background-position: 50% 0;
background-size: 100% 100%;
/* this blure all card */
filter: blur(8px);
-webkit-filter: blur(8px);
}
What I have: example what i have What I need: example what i need This is what I got as a result of adding this code:
mat-card:before {
content: ' ';
display: block;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 0;
opacity: 0.2;
background-image: url('img url');
background-repeat: no-repeat;
background-position: 50% 0;
background-size: 100% 100%;
filter: blur(10px);
-webkit-filter: blur(10px);
}
But this method does not suit me because pseudo elements are not part of DOM tree, and because of that do not expose any DOM API that can be used to interact with them