Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

Really cool CSS gradient border effect I recreated after seeing it on the warp website. Demo: Code:

188,168 Aufrufe • vor 3 Jahren •via X (Twitter)

10 Kommentare

Profilbild von Geoffrey Shepard
Geoffrey Shepardvor 3 Jahren

Woah, never seen anything like it. Cool trick, a little distracting, but has a use case somewhere

Profilbild von Wes Bos
Wes Bosvor 3 Jahren

Ha def could be distracting. Use case is to make you say "Woah, never seen anything like it" 😀

Profilbild von John Hooks
John Hooksvor 3 Jahren

Thanks for breaking that down. It’s a really cool effect.

Profilbild von Wei Su
Wei Suvor 3 Jahren

Thank u Wes, I’m gonna steal the green one.

Profilbild von Karol Głomski ⌨ 🐍
Karol Głomski ⌨ 🐍vor 3 Jahren

how do I save a tweet for later?

Profilbild von Hagai Bloch
Hagai Blochvor 3 Jahren

Damn, that's cool, now I will put it anywhere I can unnecessarily until my product manager yell at me.

Profilbild von Lucas Nunes | Lukinh4Z
Lucas Nunes | Lukinh4Zvor 3 Jahren

@Reimanzzzzzzzz

Profilbild von Tyler Freedman
Tyler Freedmanvor 3 Jahren

Is there a way to make this effect happen in intervals by itself? I'm fairly new to CSS

Profilbild von Wes Bos
Wes Bosvor 3 Jahren

Yep, you would use a setInterval to run code every 5 seconds, and each time that runs you toggle a class of “start”

Profilbild von Odii
Odiivor 3 Jahren

Amazing 🔥 Trust the full version is on YouTube now, need to try this!

Ähnliche Videos

CSS Trick! 🤙 You can create gradient borders on translucent elements using mask-clip and mask-composite with a pseudo-element 🔥 .gradient-border::after { mask-clip: padding-box, border-box; mask-composite: intersect; mask: linear-gradient(transparent, transparent), linear-gradient(white, white); } It's the same "Transparent border trick" from before. But, now you apply it to a pseudo-element 😎 The trick is to create a pseudo-element with a gradient background and then mask it so we only see the part we want, the border ✨ mask-clip defines the area affected by a mask. Similar to how you can define background-size. Using padding-box and border-box constrains the two masks. mask-composite is the magic part ✨ It defines a compositing operation for stacked mask layers. Using intersect means that the parts that overlap get replaced. And this seems to work in all browsers 🙌 As for the rest of the styles... – Make sure you set pointer-events: none on the pseudo-element – Make sure it fills the parent element. You can use position: absolute and inset: 0 – Make sure the background fills the space including the border-width. You can use calc to achieve that: --bg-size: calc(100% + (2px * var(--border))); background: var(--gradient) center center / var(--bg-size) var(--bg-size); That's it! 🚀 Gradient borders on translucent elements. You can set all the backdrop-filter: blur() you like! 😅 CodePen.IO link below! 👇

jhey ʕ•ᴥ•ʔ

269,739 Aufrufe • vor 2 Jahren