I have read tons of posts about folks trying to make this kind of shape and the best solution I have is to use mix-blend-mode:screen;
. These posts were 5+ years old so I am hoping there is a new kind of solution.
However, I also need the text to not be impacted by the mix-blend-mode
. I have tried isolation:isolate;
in a wrapper <div>
, but that didn't help since the circle just disappeared or wouldn't knockout the white container, just blended with it (yes I realize that's what it's supposed to do, just not what I need it to do). I have also tried to place the text in a separate <div>
and use position:absolute;
while that worked on desktop, it wasn't responsive and seems really hacky.
So, in short I need to make what I have below without impacting the text color on the content.
Any help is greatly appreciated.
.bg {
background: #666;
height: 100vh;
padding: 50px;
}
.flag {
background-color: white;
mix-blend-mode: screen;
height: auto;
padding: 20px;
width: 400px;
overflow: hidden;
position: relative;
}
.flag p {
font-family: 'Helvetica Neue LT Std 47 Light Condensed',Helvetica,Arial,Lucida,sans-serif;
color: #58595B!important;
font-size: 16px;
}
.green {
color: #B3BE35;
}
.flag-circle {
background-color: black;
border-radius: 50%;
width: 175px;
height: 165%;
position: absolute;
top: -32%;
right: -150px;
}
<div class="bg">
<div class="flag">
<p>
In this example <strong class="green">the text needs to be normal</strong> and the mix-blend-mode should only apply to the circle cutting out the right side of the "flag".
</p>
<div class="flag-circle"></div>
</div>
</div>