I need to create custom shapes for a client project. They are expecting responsive rounded divs. For that, we try using clip path in combination with svg filter to round the edges.
However, I can't make this thing work. What are workarounds that I can try to make this thing nice and responsive while having a complex shape?
Also, note that the edges are cut off by the filter...
Here is the code I currently have that provides the best looking results :
.shape-14 {
position: relative;
background: #000000;
width: 33%;
height: 100%;
min-height: 370px;
clip-path: polygon(0 0, 128px 0, 128px 104px, 100% 104px, 100% 100%, 0 100%, 0 0);
}
.shape-14::before {
content: '';
width: calc(100% - 8px);
height: calc(100% - 8px);
background: #FDEEE1;
display: block;
position: absolute;
top: 4px;
left: 4px;
clip-path: polygon(0 0, 120px 0, 120px 104px, 100% 104px, 100% 100%, 0 100%, 0 0);
}
.shape-14-wrapper {
grid-column-gap: 16px;
grid-row-gap: 16px;
align-items: stretch;
display: flex;
}
.css-shape-blur {
filter: url('data:image/svg+xml,\
<svg xmlns="http://www.w3.org/2000/svg">\
<filter id="corners">\
<feGaussianBlur in="SourceGraphic" stdDeviation="5" />\
<feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 22 -16" />\
<feComposite in="SourceGraphic" in2="corners" operator="in"/>\
</filter>\
</svg>#corners')
}
<div class="css-shape-blur">
<div class="shape-14-wrapper">
<div class="shape-14">
<p class="p-card">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.
</p>
</div>
<div class="shape-14">
<p class="p-card">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.
</p>
</div>
</div>
</div>
</div>