I have the following markup:
<label
className={classes.trigger}
htmlFor={uniqueId}
ref={labelRef}
style={{ background: val, borderColor: val }}
/>
The css is as followed:
.trigger {
display: block;
position: relative;
&::before {
content: "";
position: absolute;
height: 40px;
width: 40px;
/* this works*/
// background: inherit;
/*This dosn't*/
background: linear-gradient(90deg, inherit, #00000000);
}
}
I want to have a background color that fades away, I'm setting the background color programmatically.
When i simply say
background: inherit;
It works perfectly, But when i want to make it look like it's fading using a linear-gradient it's not working anymore
background: linear-gradient(90deg, inherit, #00000000);
Why is that? I read around that the browser treats gradients like an image (or something in that ball park), So is this even possible to do the way I'm going about it? Or is there some trick to achive this?