JSFiddle - React, Tailwind, and code Playground

by vovcat

HTML

<div class="menu-item"><span>text</span></div>

CSS

body {
    padding: 100px;
}

.menu-item {
    border-left: 2px solid #c00;
    border-right: 2px solid #c00;
    position: relative;
    background: #ccc;
    width: 100px;
    height: 59px;
}

.menu-item span {
    position: relative;
    text-align: center;
    display: block;
    line-height: 59px;
    width: 100px;
    color: #fff;
    z-index: 1;
}

.menu-item:after,
.menu-item:before {
    content: '';
    display: block;
    position: absolute;
    border-left: 2px solid #c00;
    border-right: 2px solid #c00;
    left: -1px;
    top: 0px;
    right: -1px;
    bottom: 1px;
    transform: rotate(-60deg);
    background: #ccc;
    /*z-index: -1;*/
}

.menu-item:before {
    transform: rotate(60deg);
}

.menu-item:hover {
    background: #999;
}
.menu-item:hover:after,
.menu-item:hover:before {
    background: #999;
}