.rainbow {
position: relative;
padding: 2rem;
width: 350px;
height: 250px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 10px;
color: #454545;
font-family: 'OpS', sans-serif;
font-weight: 700;
overflow: hidden;
z-index: 0;
&::before {
content: '';
position: absolute;
left: -50%;
top: -50%;
width: 200%;
height: 200%;
background-repeat: no-repeat;
background-size: 50% 50%, 50% 50%;
background-position: 0 0, 100% 0, 100% 100%, 0 100%;
background-image: linear-gradient(#399953, #399953), linear-gradient(#fbb300, #fbb300), linear-gradient(#d53e33, #d53e33), linear-gradient(#377af5, #377af5);
animation: rotate 4s linear infinite;
z-index: -2;
}
&::after {
content: '';
position: absolute;
left: 6px;
top: 6px;
width: calc(100% - 12px);
height: calc(100% - 12px);
border-radius: 5px;
background: #fff;
z-index: -1;
}
}
@keyframes rotate {
100% { transform: rotate(1turn); }
}