I am trying to clip out a concave edge on the right side of a div (to make a curving sidebar, ultimately). I have struggled with CSS to make this happen.
I got quite close by wrapping the rest of the content in a div with border-radius-top-left
and border-radius-bottom-left
, creating the illusion of a curving sidebar:
.contentMask {
margin-left: 12%;
border-top-left-radius: 12% 50%;
border-bottom-left-radius: 11% 47%;
}
The result, however, does not follow a curve in the manner i desire - it's more like an ellipse with a very flat edge. I can't get it right. Is there a way to create a sidebar like this, following an arc I can define?
Edit for posterity: I got a bit closer to what I wanted by an additional hack. I made the content taller than the screen with extra vertical space, then used negative top margin to scroll it back into place. Then I made the outer container of the whole thing height: 100vh
and overflow: hidden
, thus allowing me to basically clip off part of the curve and achieve the arc I wanted. Only problem now is I can't really add box-shadow this way.