Skip to content Skip to sidebar Skip to footer

Border Radius For A Clip Path Having Border Created From Shadow

I have this shape where top div is dynamic and i need to add border radius accross these corners. shape is made of two divs having shared linear gradient background. and border is

Solution 1:

Here is an idea where I will consider an SVG filter I used in this previous answer. Adjust the stdDeviation value to control the radius:

#parent {
  width: max-content;
  background:linear-gradient(to bottom left, transparent,rgba(255,255,255,0.75),transparent,rgba(255,255,255,0.75),transparent,rgba(255,255,255,0.75)) yellow;
}

#pool-container {
  padding: 10px;
  width: 200px;
  margin: 05px05px;
  display: flex;
  flex-direction: column;
  position: relative;
  filter: url('#goo') drop-shadow(0px -2px0px black) drop-shadow(0px2px0px black) drop-shadow(-2px0px0px black) drop-shadow(2px0px0px black) 
}

#side-step {
  height: 80px;
  width: 80px;
  transition: 1s all;
}

#pool-container:hover#side-step {
  margin-left: 120px;
}

#side-step,
#main-pool {
  clip-path: polygon(00, 100%0, 100%100%, 0100%);
}

#side-step::before,
#main-pool::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient( 120deg, rgba(248, 201, 129, 1) 0%, rgba(227, 76, 145, 1) 100%);
}

#main-pool {
  width: 100%;
  height: 150px;
}
<divid="pool-container"><divid="side-step"></div><divid="main-pool"></div></div><svgstyle="visibility: hidden; position: absolute;"width="0"height="0"xmlns="http://www.w3.org/2000/svg"version="1.1"><defs><filterid="goo"><feGaussianBlurin="SourceGraphic"stdDeviation="10"result="blur" /><feColorMatrixin="blur"mode="matrix"values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 19 -9"result="goo" /><feCompositein="SourceGraphic"in2="goo"operator="atop"/></filter></defs></svg>

Post a Comment for "Border Radius For A Clip Path Having Border Created From Shadow"