JSFiddle - React, Tailwind, and code Playground
HTML
<div class="diamond"></div>
CSS
.diamond {
left: 50px;
top: 50px;
position: absolute;
height: 88px;
width: 300px;
background-color: transparent;
-webkit-perspective: 100px;
-moz-perspective: 100px;
perspective: 100px;
}
.diamond:before {
content: '';
width: 100%;
height: 51%;
left: 0%;
top: 0%;
position: absolute;
border-color: red;
border-style: solid;
border-width: 3px 3px 0px 3px;
-webkit-transform: rotateX(20deg);
-moz-transform: rotateX(20deg);
transform: rotateX(20deg);
border-radius: 6px;
background-color: blue;
}
.diamond:after {
content: '';
width: 100%;
height: 111%;
left: 0%;
bottom: 0%;
position: absolute;
border-color: red;
border-style: solid;
border-width: 0px 3px 3px 3px;
-webkit-transform: rotateX(-20deg);
-moz-transform: rotateX(-20deg);
transform: rotateX(-20deg);
border-radius: 6px;
background-color: lightblue;
}