JSFiddle - React, Tailwind, and code Playground
CSS
@import url('https://fonts.googleapis.com/css2?family=Neucha&display=swap');
* {
box-sizing: inherit;
}
html {
box-sizing: border-box;
}
body {
padding: 50px;
margin: 0;
font-family: 'Neucha', cursive;
}
div {
position: relative;
width: 200px;
height: 200px;
border-radius: 4px;
background: #fff;
}
div::before {
content: "";
position: absolute;
top: -2px;
bottom: -2px;
right: -2px;
left: -2px;
border-radius: 5px;
background: linear-gradient(to top left, pink 30px, transparent 31px, transparent calc(50% - 30px), pink calc(50% - 30px), pink calc(50% + 30px), transparent calc(50% + 30px), transparent calc(100% - 31px), pink calc(100% - 30px) );
z-index: -1;
}