Skip to content

Instantly share code, notes, and snippets.

@gmcusaro
Created April 21, 2022 07:57
Show Gist options
  • Save gmcusaro/474726b85722df30ce0899a380222f78 to your computer and use it in GitHub Desktop.
Save gmcusaro/474726b85722df30ce0899a380222f78 to your computer and use it in GitHub Desktop.
Card color border animation
.card {
position: relative;
background-color: #fff;
padding: 20px;
border-radius: 5px;
margin: 20px;
}
.card::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: calc(100% + 8px);
height: calc(100% + 8px);
transform: translate(-4px, -4px);
background: linear-gradient(60deg, #5beb8b, #648bf5, #a964f3, #f25fd0, #f7736a, #fdcf52) 0 50%;
background-size: 300% 300%;
animation: gradient 10s ease-in-out infinite;
border-radius: 8px;
z-index: -1;
}
@keyframes gradient {
0%{background-position:0% 50%}
50%{background-position:100% 50%}
100%{background-position:0% 50%}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment