In this example, I want the purple rectangle to change its opacity to 100% regardless of the value of the parent. I tried using all: unset/initial and !important but it doesn't seem to work.
.rect {
width: 500px;
height: 600px;
margin-top: 200px;
margin-left: 300px;
background-color: black;
/* this V */
opacity: 37%;
z-index: -1;
}
.rect1 {
all: unset;
position: absolute;
z-index: 10;
width: 259px;
height: 300px;
margin-top: 500px;
margin-left: 50px;
background-color: purple;
/* to this V */
opacity: 100% !important;
}
<div class="rect">
<div class="rect1"></div>
</div>