JSFiddle - React, Tailwind, and code Playground
HTML
<div class='menu'>
<a href='#'>Item 1</a>
<a href='#'>Item 2</a>
</div>
CSS
.menu {
padding: 0 10px;
}
.menu a {
display: inline-block;
background: black;
color: white;
z-index: 2;
padding: 0 10px;
height: 30px;
line-height: 30px;
margin: 0 15px;
position: relative;
}
.menu a:after {
display: block;
content: ' ';
position: absolute;
top: 0;
right: -30px;
z-index: -1;
width: 0;
height: 0;
border-style: solid;
border-width: 30px 30px 0 30px;
border-color: black transparent transparent transparent;
}
.menu a:before {
display: block;
content: ' ';
position: absolute;
top: 0;
left: -30px;
z-index: -1;
width: 0;
height: 0;
border-style: solid;
border-width: 0 30px 30px 30px;
border-color: transparent transparent black transparent;
}
.menu a:hover {
background: red;
}
.menu a:hover:before{
border-bottom-color: red;
}
.menu a:hover:after {
border-top-color: red;
}