JSFiddle - React, Tailwind, and code Playground
by Nir Azuelos
HTML
<div id="box">
Hello World!
</div>
CSS
#box {
position: relative;
width: 60%;
background: #ddd;
-moz-border-radius: 4px;
border-radius: 4px;
padding: 2em 1.5em;
color: rgba(0,0,0, .8);
text-shadow: 0 1px 0 #fff;
line-height: 1.5;
margin: 60px auto;
font-family: Sans-Serif;
font-weight: bold;
text-align: center;
}
#box:before {
content: '';
position: absolute;
width: 21%;
height: 125px;
top: 1px;
right: -94px;
z-index: -1;
background: #333;
-webkit-transform: skew(40deg);
-webkit-mask-position: 0 0;
-webkit-mask-size: 10px 10px;
-webkit-mask-box-image: -webkit-gradient(linear, left top, left bottom,
color-stop(0.00, rgba(0,0,0,1)),
color-stop(0.70, rgba(0,0,0,1)),
color-stop(0.90, rgba(0,0,0,0.5)),
color-stop(1.00, rgba(0,0,0,0)));
}
#box:after {
content: '';
position: absolute;
height: 40px;
width: 100%;
bottom: -39px;
left: 18px;
z-index: 1;
-webkit-transform: skew(40deg);
background: #333;
-webkit-mask-position: 0 0;
-webkit-mask-size: 10px 10px;
-webkit-mask-box-image:
-webkit-gradient(linear, left top, left bottom,
color-stop(0.00, rgba(0,0,0,1)),
color-stop(0.50, rgba(0,0,0,0.5)),
color-stop(1.00, rgba(0,0,0,0)));
}