JSFiddle - React, Tailwind, and code Playground
CSS
body {
background: #fff;
}
div {
width: 300px;
height: 150px;
background:
linear-gradient(-135deg, #fff 0, #fff 15px, #000 16px, #000 17px, transparent 18px, transparent) no-repeat,
linear-gradient(135deg, #fff 0, #fff 15px, #000 16px, #000 17px, transparent 18px, transparent) no-repeat,
linear-gradient(-45deg, #fff 0, #fff 15px, #000 16px, #000 17px, transparent 18px, transparent) no-repeat,
linear-gradient(45deg, #fff 0, #fff 15px, #000 16px, #000 17px, transparent 18px, transparent) no-repeat,
linear-gradient(to bottom, #000 0, #000 2px, transparent 3px, transparent calc(100% - 3px), #000 calc(100% - 2px), #000) no-repeat,
#f00 linear-gradient(to right, #000 0, #000 2px, transparent 3px, transparent calc(100% - 3px), #000 calc(100% - 2px), #000) no-repeat;
}