JSFiddle - React, Tailwind, and code Playground
by Gregor Adams
HTML
<div id="inner">
<p>I am pure CSS</p>
<p>I am only one <div> with :before and :after pseudo-elements</p>
</div>
CSS
body {
background: #864;
height:100%;
width:100%;
font-family: Monospace;
}
#inner {
height: 150px;
width: 250px;
position: absolute;
left: 100px;
top: 100px;
color: white;
font-size: 16px;
padding:20px;
border-radius: 20px;
border-top-left-radius: 0;
}
#inner:before {
content: "";
height: 100px;
width: 100px;
border-radius: 100px;
position: absolute;
top: -50px;
left: -50px;
-webkit-transform: rotateZ(180deg);
}
#inner {
background: rgba(0,0,0,0.5) /*this is the full color-code of the div (with alpha)*/
}
#inner:before {
/*the solid color of the circle = rgbValue of the div*/
background-image: -webkit-linear-gradient(transparent 50%, rgb(0, 0, 0) 50%, rgb(0, 0, 0)),
-webkit-linear-gradient(0deg, transparent 50%, rgb(0, 0, 0) 50%, rgb(0, 0, 0));
/*opacity of the circle = alpha of the div*/
opacity: 0.5;
}