JSFiddle - React, Tailwind, and code Playground

by Gregor Adams

HTML

<div id="inner">
    <p>I am pure CSS</p>
    <p>My pseudo-element is a pacman and it's trying to eat me</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:after {
    content: "";
    height: 10px;
    width: 10px;
    border-radius: 10px;
    position: absolute;
    top: -25px;
    left: 15px;
}

#inner {
background: rgba(0,0,0,0) /*this is the full color-code of the div (with alpha)*/
}
#inner:after {
    background: rgb(0,0,0);
}
#inner:before {
    /*the solid color of the circle = rgbValue of the div*/
    background-image: -webkit-linear-gradient(transparent 50%, rgb(255, 255, 0) 50%, rgb(255, 255, 0)),
        -webkit-linear-gradient(0deg, transparent 50%, rgb(255, 255, 0) 50%, rgb(255, 255, 0));
    /*opacity of the circle = alpha of the div*/
    opacity: 1;
}