Unique Answer
After reviewing the latest update, here is a new approach you can take. Try creating an inverted version of your logo where the transparent part becomes solid and vice versa. Then, use multiple mask layers to achieve the desired effect.
I have centered the logo on the overlay following the same concept as before:
.overlay {
--h:200px; /* height of the logo*/
--w:200px; /* width of the logo */
height:300px;
background:radial-gradient(farthest-side,black 50%,transparent 52%) 0 0/8px 8px;
-webkit-mask:
linear-gradient(#fff,#fff) top /100% calc(50% - var(--h)/2),
linear-gradient(#fff,#fff) bottom/100% calc(50% - var(--h)/2),
linear-gradient(#fff,#fff) left /calc(50.1% - var(--w)/2) 100%,
linear-gradient(#fff,#fff) right /calc(50.1% - var(--w)/2) 100%,
url(https://i.ibb.co/1zDbtJw/logo.png) center/var(--w) var(--h);
mask:
linear-gradient(#fff,#fff) top /100% calc(50% - var(--h)/2),
linear-gradient(#fff,#fff) bottom/100% calc(50% - var(--h)/2),
linear-gradient(#fff,#fff) left /calc(50% - var(--w)/2) 100%,
linear-gradient(#fff,#fff) right /calc(50% - var(--w)/2) 100%,
url(https://i.ibb.co/1zDbtJw/logo.png) center/var(--w) var(--h);
-webkit-mask-repeat:no-repeat;
mask-repeat:no-repeat;
}
body {
background:url(https://i.picsum.photos/id/44/800/800.jpg) center/cover;
}
<div class="overlay"></div>
For a detailed explanation and demonstration on how to create a new version of the logo, refer to this related question:
You can also experiment with using `mask-composite` to maintain the original logo while making it easier to adjust and reposition. Note the importance of layer order in this example compared to the previous method:
.overlay {
height:300px;
background:radial-gradient(farthest-side,black 50%,transparent 52%) 0 0/8px 8px;
-webkit-mask:
linear-gradient(#fff,#fff),
url(https://i.ibb.co/cKBT5WQ/logo.png) center/200px 200px;
-webkit-mask-repeat:no-repeat;
-webkit-mask-composite:source-out;
mask:
linear-gradient(#fff,#fff),
url(https://i.ibb.co/cKBT5WQ/logo.png) center/200px 200px;
mask-repeat:no-repeat;
mask-composite:exclude;
}
body {
background:url(https://i.picsum.photos/id/44/800/800.jpg) center/cover;
}
<div class="overlay"></div>
Original Approach
To achieve the desired design without relying on images, I suggest using pure CSS:
.overlay {
height:300px;
/* stripes */
background:repeating-linear-gradient(to right,blue 0 10px,transparent 10px 20px);
/* mask */
-webkit-mask:
linear-gradient(#fff,#fff) top /100% 50px,
linear-gradient(#fff,#fff) bottom/100% 50px,
linear-gradient( 235deg,transparent 10%,#fff 9%) calc(50% - 600px) 50%/1200px calc(100% - 100px),
linear-gradient(-235deg,transparent 10%,#fff 9%) calc(50% + 600px) 50%/1200px calc(100% - 100px);
-webkit-mask-repeat:no-repeat;
mask:
linear-gradient(#fff,#fff) top /100% 50px,
linear-gradient(#fff,#fff) bottom/100% 50px,
linear-gradient( 235deg,transparent 10%,#fff 9%) calc(50% - 600px) 50%/1200px calc(100% - 100px),
linear-gradient(-235deg,transparent 10%,#fff 9%) calc(50% + 600px) 50%/1200px calc(100% - 100px);
mask-repeat:no-repeat;
}
body {
background:url(https://i.picsum.photos/id/44/800/800.jpg) center/cover;
}
<div class="overlay"></div>
Below is the gradient used for the mask with various color combinations to illustrate the puzzle visually:
.overlay {
height:300px;
background:
linear-gradient(blue,blue) top /100% 50px,
linear-gradient(red,red) bottom/100% 50px,
linear-gradient( 235deg,transparent 10%,green 9%)
calc(50% - 600px) 50% / 1200px calc(100% - 100px),
linear-gradient(-235deg,transparent 10%,purple 9%)
calc(50% + 600px) 50%/1200px calc(100% - 100px);
background-repeat:no-repeat;
}
body {
background:url(https://i.picsum.photos/id/44/800/800.jpg) center/cover;
}
<div class="overlay"></div>
Here's another syntax that utilizes CSS variables for easy triangle control:
.overlay {
--h:200px; /* height of the triangle*/
--w:200px; /* width of the triangle */
height:300px;
/* stripes */
background:repeating-linear-gradient(to right,blue 0 10px,transparent 10px 20px);
/* mask */
-webkit-mask:
linear-gradient(#fff,#fff) top /100% calc(50% - var(--h)/2),
linear-gradient(#fff,#fff) bottom/100% calc(50% - var(--h)/2),
linear-gradient(#fff,#fff) left /calc(50% - var(--w)/2) 100%,
linear-gradient(#fff,#fff) right /calc(50% - var(--w)/2) 100%,
linear-gradient(to top right,#fff 49%,transparent 50%) calc(50% - var(--w)/4) 50%/calc(var(--w)/2) var(--h),
linear-gradient(to top left ,#fff 49%,transparent 50%) calc(50% + var(--w)/4) 50%/calc(var(--w)/2) var(--h);
-webkit-mask-repeat:no-repeat;
mask:
linear-gradient(#fff,#fff) top /100% calc(50% - var(--h)/2),
linear-gradient(#fff,#fff) bottom/100% calc(50% - var(--h)/2),
linear-gradient(#fff,#fff) left /calc(50% - var(--w)/2) 100%,
linear-gradient(#fff,#fff) right /calc(50% - var(--w)/2) 100%,
linear-gradient(to top right,#fff 49%,transparent 50%) calc(50% - var(--w)/4) 50%/calc(var(--w)/2) var(--h),
linear-gradient(to top left ,#fff 49%,transparent 50%) calc(50% + var(--w)/4) 50%/calc(var(--w)/2) var(--h);
mask-repeat:no-repeat;
}
body {
background:url(https://i.picsum.photos/id/44/800/800.jpg) center/cover;
}
<div class="overlay"></div>