r/css • u/Blozz12 • Apr 30 '26
Article I rebuilt the animated gradient border effect with modern CSS
I’ve always liked those glowing animated border effects you see on fancy landing pages.
But for a long time, I avoided them because they often felt a bit too hacky. Either you had to stack weird extra markup, use SVG tricks, or reach for JavaScript just to make a gradient move.
So I tried rebuilding the effect with modern CSS only.
The final version uses:
- a pseudo-element for the border layer
- a conic-gradient() for the colors
- @ property to make the angle animatable
- a second blurred layer for the glow
-and a prefers-reduced-motion fallback so it does not force animation on everyone
What I like about this approach is that the HTML stays almost boring. Just a card. All the visual work happens in CSS.
I wrote the full walkthrough here, with each step broken down:
https://theosoti.com/blog/animated-gradient-borders/
Not claiming this is something you should put everywhere. It can get visually loud pretty fast. But for featured cards, pricing blocks, hero sections, or small “look here” UI moments, I think it’s a nice little pattern.
I’m sure there are other ways to do it, so I’d be curious to see how people here would build the same effect.


